-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Generics for cmf #167
Generics for cmf #167
Conversation
composer.json
Outdated
@@ -31,7 +31,7 @@ | |||
"require-dev": { | |||
"composer/package-versions-deprecated": "^1.11", | |||
"phpstan/phpstan": "^0.12", |
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.
shouldn't this be bumped to ^0.12.84
as you rely on the fixed behavior of that release ?
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 didn't follow the latest developments on PHPStan so I don't know that I am, but sure, let's do this 👍
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.
well, look at the diff on the baseline file 😄
The removed entry had a link to a phpstan issue, which got solved in 0.12.84. That's how I found out the necessary version
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.
Oh, right, already forgot about that 😅
This should make a lot of static analysis issues vanish, because tools will be able to understand that they are guaranteed to receive some specialization of ClassMetadata, or that they should provide it.
845a15f
to
b066680
Compare
@orklah please review |
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 did not checkout the code and don't have thorough overview over doctrine/persistence but the changes I see on Github seem 👌🏾
@@ -232,6 +238,7 @@ public function getMetadataFor($className) | |||
if ($this->cache) { | |||
$cached = $this->cache->getItem($this->getCacheKey($realClassName))->get(); | |||
if ($cached instanceof ClassMetadata) { | |||
/** @psalm-var CMTemplate $cached */ |
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.
This feels like cheating, but without trying to wrap the cache interface, I'm not sure we can do better
composer.json
Outdated
@@ -30,8 +30,8 @@ | |||
}, | |||
"require-dev": { | |||
"composer/package-versions-deprecated": "^1.11", | |||
"phpstan/phpstan": "^0.12", | |||
"doctrine/coding-standard": "^6.0 || ^8.0", | |||
"phpstan/phpstan": "^0.12.84", |
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'd advise pinning the version of static tools, especially now that we started deploying baseline. It will make sure the version used to generate the baseline is the same for everyone, and make sure not to break builds the day before the release :)
This ensures baseline files are generated with the same version by everyone, and should stabilize the build.
This should make a lot of static analysis issues vanish, because tools
will be able to understand that they are guaranteed to receive some
specialization of ClassMetadata, or that they should provide it.
Also upgraded to doctrine/coding-standard 9 so make sure to review commit by commit, it will be easier.