-
-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ | |
use PHPUnit\Framework\TestCase; | ||
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator; | ||
use Symfony\Component\Uid\Factory\UuidFactory; | ||
use Symfony\Component\Uid\NilUuid; | ||
use Symfony\Component\Uid\Uuid; | ||
use Symfony\Component\Uid\UuidV4; | ||
use Symfony\Component\Uid\UuidV6; | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. /cc @fancyweb FYI, this test was breaking the contracts |
||
$em = new EntityManager(); | ||
$factory = $this->createMock(UuidFactory::class); | ||
$factory->expects($this->any()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,7 @@ public function getLastUsed() | |
public function clear() | ||
{ | ||
// nothing to do | ||
return null; | ||
} | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
foreach ($this->functions->getProvidedServices() as $function => $type) { | ||
yield new ExpressionFunction( | ||
$functions[] = new ExpressionFunction( | ||
$function, | ||
static function (...$args) use ($function) { | ||
return sprintf('($context->getParameter(\'_functions\')->get(%s)(%s))', var_export($function, true), implode(', ', $args)); | ||
|
@@ -45,6 +47,8 @@ function ($values, ...$args) use ($function) { | |
} | ||
); | ||
} | ||
|
||
return $functions; | ||
} | ||
|
||
public function get(string $function): callable | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
*/ | ||
public function createToken(Passport $passport, string $firewallName): TokenInterface | ||
{ | ||
|
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
Uh oh!
There was an error while loading. Please reload this page.
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