-
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 type declarations where backwards-compatible #8544
Conversation
d44eb39
to
caf8c70
Compare
Thanks for the careful review @simonberger , much appreciated 👍 |
caf8c70
to
bcce2a0
Compare
lib/Doctrine/ORM/Cache/Persister/Entity/NonStrictReadWriteCachedEntityPersister.php
Outdated
Show resolved
Hide resolved
{ | ||
$namespace = $this->getClassNamespace($fullClassName); | ||
|
||
return $namespace ? 'namespace ' . $namespace . ';' : ''; | ||
} | ||
|
||
/** | ||
* @param string $fullClassName |
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.
class-string
5d090db
to
507a115
Compare
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.
One comment remaining. Also, you are adding object type declarations, but these are being removed in #8613. That will cause mess of a conflict.
use Doctrine\DBAL\LockMode; | ||
use Doctrine\DBAL\Platforms\AbstractPlatform; | ||
use Doctrine\DBAL\Statement; |
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.
Unsure if we should wait for doctrine/dbal#4596 and revert this change in use statements. I think that change might be good because more forward compatible.
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'll leave you decide. But to me, such change seems a bit unrelated to this PR
I will wait until #8613 is resolved |
105670f
to
6afe86a
Compare
The 7.1 PR has been merged, let's rebase to be 100% sure it still works |
6afe86a
to
e1827c4
Compare
e1827c4
to
32e3a5a
Compare
This includes: - private methods - return type declarations of final protected methods - return type declarations of public and protected methods of final classes Parameter type declarations are a more delicate matter and should probably be handled separately to make it easier to catch issues during code review. Type declarations can be more trusted than simple phpdoc when it comes to static analysis, having them means we can infer the phpdoc of calling methods with confidence. Note that it seems that some of the phpdoc I initially inferred these declarations from were apparently wrong, in particular some mentioning Doctrine\Dbal\Statement when was is really passed around is Doctrine\Dbal\Driver\Statement.
32e3a5a
to
55f030f
Compare
This includes:
Parameter type declarations are a more delicate matter and should
probably be handled separately to make it easier to catch issues during
code review.
Type declarations can be more trusted than simple phpdoc when it
comes to static analysis, having them means we can infer the phpdoc of
calling methods with confidence.
Note that it seems that some of the phpdoc I initially inferred these
declarations from were apparently wrong, in particular some mentioning
Doctrine\Dbal\Statement
when was is really passed around isDoctrine\Dbal\Driver\Statement
.Closes #8538