-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add a constructor to CacheKey
#10212
Add a constructor to CacheKey
#10212
Conversation
da62e25
to
f7f13a4
Compare
public function __construct(string $hash) | ||
{ | ||
$this->hash = $hash; | ||
parent::__construct($hash); | ||
} |
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.
🤔 Can't you remove the constructor entirely instead? Or maybe even the whole class is useless?
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.
Actually we would need a test with constructor and without, because despite the deprecation both ways need to work.
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.
🤔 Can't you remove the constructor entirely instead?
I can, but I was reluctant to do so because it's stricter than CacheKey
's.
Or maybe even the whole class is useless?
CacheKey
is abstract and I don't really want to change that. So if we dropeed CacheKeyMock
, I would need to replace it with an anonymous class in every test that uses it. I'm not sure that's an improvement really.
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.
Actually we would need a test with constructor and without, because despite the deprecation both ways need to work.
I've pushed two new tests.
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.
Didn't notice the extra strictness 👍
f7f13a4
to
a018ad5
Compare
* 2.14.x: Add a constructor to CacheKey (doctrine#10212) Psalm 4.30.0, PHPStan 1.9.2 (doctrine#10213) Allow "Expr\Func" as condition in join (doctrine#10202) refactor: use list type in SchemaTool (doctrine#10199)
* 2.14.x: Add a constructor to CacheKey (doctrine#10212) Psalm 4.30.0, PHPStan 1.9.2 (doctrine#10213) Allow "Expr\Func" as condition in join (doctrine#10202) refactor: use list type in SchemaTool (doctrine#10199)
Prepares #10210 on 2.14.x.