-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set properties autowired with @required as initialized #348
Set properties autowired with @required as initialized #348
Conversation
d9b295f
to
238cd47
Compare
f962e83
to
45e92c3
Compare
@ondrejmirtes could you re-review this PR please? Thank you :) |
$container->getServicesByTag(AdditionalConstructorsExtension::EXTENSION_TAG); | ||
|
||
return new UninitializedPropertyRule( | ||
new ConstructorsHelper( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fetch the rule with $container->getByType(UninitializedPropertyRule::class)
. It should be possible. That way it doesn't have to be in the baseline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done that and removed it from the baseline, however, it still fails on the same thing;
Accessing PHPStan\Rules\Properties\UninitializedPropertyRule::class is not covered by backward compatibility promise. The class might change in a minor PHPStan version.
public function getAdditionalConstructors(ClassReflection $classReflection): array | ||
{ | ||
$additionalConstructors = []; | ||
/** @var ReflectionClass $nativeReflection */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the inline @var
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On PHP 7.3 and lower this will throw the following;
Call to method getMethods() on an unknown class PHPStan\BetterReflection\Reflection\Adapter\ReflectionEnum.
I'm not quite sure what to do with this, as I'm confused as to why it would do this only on PHP 7.3 and lower
ef1b4bb
to
cee621e
Compare
7891218
to
ab20c93
Compare
I have a couple issues here which I'm having a hard time getting resolved, as they fail on some PHP versions and succeed on others. I've baselined them, but unfortunately This following error is actually also baselined in
Secondly, on the lowest dependency builds, I get the following errors. On the highest dependencies, this builds correctly. What I've done is removed the
These are the only things holding this PR back, so hopefully you can help me out by pointing me towards a solution here. Thanks @ondrejmirtes! |
7120655
to
931c6b5
Compare
ab20c93
to
8724f2b
Compare
8724f2b
to
253f8d3
Compare
253f8d3
to
538586f
Compare
Solved it, mainly with phpstan/phpstan-src@2b9af36, but also locking contracts package version to a newer one :) |
538586f
to
80eb1d6
Compare
Thank you. |
Fixes #346