Bruce Weirdan

Results 291 comments of Bruce Weirdan

Constructor should be allowed to be declared `final private` though: https://3v4l.org/iErYc

`$test` is already an object, so you don't really need `new` in the `throw`; you can just `throw $test`. With this said, using `new` on objects is valid in PHP...

Snippet to match the updated issue title: https://psalm.dev/r/3e0baa6d4d

> For anyone interested in fixing this, the issue is located in `UnionTypeComparator::isContainedBy()` Is it? I would expect it to be fixed in `NewAnalizer` actually (see my snippet above). >...

> That's why Psalm emits an InvalidThrow even when the anonymous class is an Exception But it doesn't: https://psalm.dev/r/2b4b9580e5 I do believe the only issue here is calling `new` on...

> I'm not sure we should allow instantiating `object`. Why not?

> extends is used for Psalter at least. I added it here: https://github.com/vimeo/psalm/pull/5146 Yeah, that's what I found. Not going to remove it then. > Not sure why [psalm.dev/r/83779ff61d](https://psalm.dev/r/83779ff61d) fails...

> Impossible to check for parameters, for visibility of `__construct` or purity. All good points. > At the very least, it should emit a `MixedMethodCall` like we do for a...