-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
More return type fixes (bis) #42490
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
More return type fixes (bis) #42490
Conversation
nicolas-grekas
commented
Aug 11, 2021
Q | A |
---|---|
Branch? | 5.4 |
Bug fix? | no |
New feature? | no |
Deprecations? | no |
Tickets | - |
License | MIT |
Doc PR | - |
9a6457d
to
96dd278
Compare
@@ -34,7 +34,7 @@ public function __construct(ManagerRegistry $registry) | |||
/** | |||
* This cache warmer is not optional, without proxies fatal error occurs! | |||
* | |||
* @return false | |||
* @return bool |
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.
false is not allowed as a standalone type
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.
But it is allowed as a PHPdoc type: https://docs.phpdoc.org/3.0/guide/references/phpdoc/types.html
And also recognized by static analysis tools as such. Should we keep @return false
and detect this as : bool
in the class loader? (feel free to ignore if you think it's not worth the effort)
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.
false
is allowed, but just not as a standalone type: it should always be part of a union
@@ -34,8 +34,10 @@ public function __construct(ServiceProviderInterface $functions) | |||
*/ | |||
public function getFunctions() | |||
{ | |||
$functions = []; |
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.
ExpressionFunctionProviderInterface
mandates an array
@@ -28,8 +28,6 @@ abstract class AbstractAuthenticator implements AuthenticatorInterface | |||
/** | |||
* Shortcut to create a PostAuthenticationToken for you, if you don't really | |||
* care about which authenticated token you're using. | |||
* | |||
* @return PostAuthenticationToken |
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.
AbstractAuthenticator
cannot force child classes to return an instance of PostAuthenticationToken
.
FormLoginAuthenticator
doesn't btw.
96dd278
to
6c55da1
Compare
c2c9d2e
to
495f073
Compare
495f073
to
c52e588
Compare
@@ -35,7 +34,7 @@ public function testUuidCanBeGenerated() | |||
|
|||
public function testCustomUuidfactory() | |||
{ | |||
$uuid = new NilUuid(); | |||
$uuid = new UuidV4(); |
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.
/cc @fancyweb FYI, this test was breaking the contracts
c52e588
to
c6a20b4
Compare