@OndrejMirtes@phpc.social avatar

OndrejMirtes

@OndrejMirtes@phpc.social

Creating https://phpc.social/@phpstan by day and night. 👨🏻‍💻👨‍👩‍👦‍👦🎮🚴‍♂️

This profile is from a federated server and may be incomplete. Browse more on the original instance.

sebastian, to boardgames
@sebastian@phpc.social avatar

Received the first today where the first name of one of the authors is Ondřej.

@OndrejMirtes 😀

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@sebastian It can be @ondrej too 😃

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

This is fine 🔥

This code is legal in PHP.

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

FYI I'm not bashing the PHP language. It's my favourite language on the planet.

I'm just bashing traits. Traits are bad.

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

Did you know that abstract method coming from a trait can be overriden with a class method with lower visibility?

So it's fine to implement "abstract public function" with "private function".

pollita, to random
@pollita@phpc.social avatar

A PHP story in three acts:

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@waynedixon @pollita Variable variables are $$foo. If $foo contains 'hello', this is gonna access $hello.

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

I can't imagine working without @Xdebug from @derickr anymore. I find opportunities to use it almost every day.

Yes, I have unit tests too. No, my code isn't 💩

When dealing with complex problems it's so much easier than var_dumping and die'ing.

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

This post by DHH nicely sums up what user's expectations should be when using open source software: https://world.hey.com/dhh/the-open-source-gift-exchange-2171e0f0

I expand this thought to PRs. By sending a PR contributor offers me a gift. I can choose to accept it or not. No one should feel bad by either outcome.

Schrank, to random
@Schrank@phpc.social avatar

Can I tell #phpstan which type a call has?

$country->getIso() is string|null, but I'm sure it is string - or at least I'm fine ignoring the unexpected case 🙈
Or do I neet to put it in a var to add a /**@var to it?

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@Schrank The question is: how do you know it, can you really be sure, and how you can tell PHPStan?

See https://phpstan.org/writing-php-code/narrowing-types for more details, and please open a GitHub discussion if you have any followup questions 😊

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

Arrived in Bavaria in time for IPC Munich and also some family time at Legoland! After waving to @sebastian across the hotel lobby, the first step is obvious:

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

assert() calls and inline @​var PHPDoc tags are usually just a crutch for bad design.

Try to prevent the problem instead, not react to it afterwards.

ramsey, to php
@ramsey@phpc.social avatar

I’ve often said the project is an experiment in anarchy. There's no BDFL, no governing board, no defined roles.

I’ve just learned a new term that I think is more appropriate for this type of organization: adhocracy.

PHP is an adhocracy.

https://en.wikipedia.org/wiki/Adhocracy

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

> Adhocracy is characterized by an adaptive, creative and flexible integrative behavior based on non-permanence and spontaneity.

I’ll accept that if we get rid of the mailing list and start using web-based thing like GitHub or Discourse like it’s 21st century.

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

As an open-source maintainer it’s my job to ruthlessly prioritize and focus on one thing until it’s finished and released.

During that time someone submits a PR about something that’s not in my priorities, and wants a review, or a bit of work from my side.

What should I do?

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@ocramius Yeah, but later is usually much later because stuff happens 😊

markusstaab, to random German
@markusstaab@phpc.social avatar

Enjoy a ~ 17% memory improvement when running @phpunit with array/objects via data-provider in the upcoming release

https://github.com/sebastianbergmann/exporter/pull/52

OndrejMirtes,
@OndrejMirtes@phpc.social avatar
OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

Twitter is bad and getting worse every day. That's why I realized I need to diversify reaching my audience with a newsletter ✉️

If you want to receive occasional news about PHPStan and related things like PHPStan Pro, sign up here: http://eepurl.com/iz7bYM

Thank you!

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

It's so annoying that we can't pass Collection<Dog> into Collection<Animal>, unless @​template is covariant.
But with @​template-covariant T, we can't use T in a @​param.

@jiripudil is on the verge of solving this with so-called type projections aka call-site variance.

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

This feature just got released in PHPStan 1.10.35! Learn more about it: https://phpstan.org/blog/guide-to-call-site-generic-variance

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

Who's looking forward to error identifiers in PHPStan 1.11? 👋

I've just implemented this part 👇

herndlm, to random
@herndlm@phpc.social avatar

was debugging a flaky test with executionOrder="defects" configured. it took me quite a while to figure out that the code under test was dependent on a constant and that constant was set in only one test case (which sometimes ran before the others which would break them)..

replaced the constant with something else that can be properly mocked and all is good. phew.

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@herndlm For these scenarios I gave @ocramius at phpDay the idea for “phpunit bisect” plugin that would run tests in different order until it found that one test that breaks another test 😀

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

What I've been up to lately and when is PHPStan 1.11 going to be released? https://github.com/phpstan/phpstan/discussions/9726#discussioncomment-6644564

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

I have a confession to make. I’m the kind of guy that brings his espresso machine on vacation with him ☕️🌴

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@usox I’m using the available space in our car trunk since we no longer have to take baby stroller with us 😊

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@Skoop That’s not necessary, they’re usually in cities with good coffee shops 😊

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@Skoop That’s my favourite one, and not just because of the coffee 😊

OndrejMirtes, to random
@OndrejMirtes@phpc.social avatar

In the last few days I dove into TypeSpecifier and improved type inference around match expressions, get_class() and gettype().

Just-released PHPStan 1.10.20 fixes 14 issues from the bug tracker, among them is the most upvoted bug report of all time, 😂

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

The 2nd most upvoted PHPStan bug of all time (annoying "property is already assigned" in if-else) is now fixed in PHPStan 1.10.23 🎉 https://github.com/phpstan/phpstan/releases/tag/1.10.23

OndrejMirtes,
@OndrejMirtes@phpc.social avatar

@herndlm The uninterrupted 3 hours of kids sleeping after lunch are hard to resist :D Last year it led to https://github.com/phpstan/phpstan/releases/tag/1.8.3, and this year it led to everything in the past 3 releases.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines