Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c6a20b4

Browse filesBrowse files
More return type fixes (bis)
1 parent 488a46f commit c6a20b4
Copy full SHA for c6a20b4

File tree

Expand file treeCollapse file tree

34 files changed

+92
-64
lines changed
Filter options
Expand file treeCollapse file tree

34 files changed

+92
-64
lines changed

‎src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct(ManagerRegistry $registry)
3434
/**
3535
* This cache warmer is not optional, without proxies fatal error occurs!
3636
*
37-
* @return false
37+
* @return bool
3838
*/
3939
public function isOptional()
4040
{

‎src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/IdGenerator/UuidGeneratorTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
1616
use Symfony\Component\Uid\Factory\UuidFactory;
17-
use Symfony\Component\Uid\NilUuid;
1817
use Symfony\Component\Uid\Uuid;
1918
use Symfony\Component\Uid\UuidV4;
2019
use Symfony\Component\Uid\UuidV6;
@@ -35,7 +34,7 @@ public function testUuidCanBeGenerated()
3534

3635
public function testCustomUuidfactory()
3736
{
38-
$uuid = new NilUuid();
37+
$uuid = new UuidV4();
3938
$em = new EntityManager();
4039
$factory = $this->createMock(UuidFactory::class);
4140
$factory->expects($this->any())

‎src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function warmUp(string $cacheDir)
4949
spl_autoload_register([ClassExistenceResource::class, 'throwOnRequiredClass']);
5050
try {
5151
if (!$this->doWarmUp($cacheDir, $arrayAdapter)) {
52-
return;
52+
return [];
5353
}
5454
} finally {
5555
spl_autoload_unregister([ClassExistenceResource::class, 'throwOnRequiredClass']);

‎src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/RouterCacheWarmerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function testWarmUpWithWarmebleInterface()
2828
$routerCacheWarmer = new RouterCacheWarmer($containerMock);
2929

3030
$routerCacheWarmer->warmUp('/tmp');
31-
$routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn('');
31+
$routerMock->expects($this->any())->method('warmUp')->with('/tmp')->willReturn([]);
3232
$this->addToAssertionCount(1);
3333
}
3434

‎src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function warmUp(string $cacheDir)
100100
{
101101
// skip warmUp when translator doesn't use cache
102102
if (null === $this->options['cache_dir']) {
103-
return;
103+
return [];
104104
}
105105

106106
$localesToWarmUp = $this->enabledLocales ?: array_merge($this->getFallbackLocales(), [$this->getLocale()], $this->resourceLocales);

‎src/Symfony/Component/Cache/Traits/RedisTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/RedisTrait.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ private function init($redis, string $namespace, int $defaultLifetime, ?Marshall
8484
*
8585
* @param array $options See self::$defaultConnectionOptions
8686
*
87-
* @return \Redis|\RedisCluster|RedisClusterProxy|RedisProxy|\Predis\ClientInterface According to the "class" option
87+
* @return \Redis|\RedisArray|\RedisCluster|RedisClusterProxy|RedisProxy|\Predis\ClientInterface According to the "class" option
8888
*
8989
* @throws InvalidArgumentException when the DSN is invalid
9090
*/

‎src/Symfony/Component/Console/Helper/HelperInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Helper/HelperInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function setHelperSet(HelperSet $helperSet = null);
2626
/**
2727
* Gets the helper set associated with this helper.
2828
*
29-
* @return HelperSet A HelperSet instance
29+
* @return HelperSet|null
3030
*/
3131
public function getHelperSet();
3232

‎src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/FooLock2Command.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function configure()
1414
$this->setName('foo:lock2');
1515
}
1616

17-
protected function execute(InputInterface $input, OutputInterface $output)
17+
protected function execute(InputInterface $input, OutputInterface $output): int
1818
{
1919
try {
2020
$this->lock();

‎src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/FooLockCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function configure()
1414
$this->setName('foo:lock');
1515
}
1616

17-
protected function execute(InputInterface $input, OutputInterface $output)
17+
protected function execute(InputInterface $input, OutputInterface $output): int
1818
{
1919
if (!$this->lock()) {
2020
return 1;

‎src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Fixtures/TestCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ protected function configure()
1616
;
1717
}
1818

19-
protected function execute(InputInterface $input, OutputInterface $output)
19+
protected function execute(InputInterface $input, OutputInterface $output): int
2020
{
2121
$output->writeln('execute called');
2222

‎src/Symfony/Component/DependencyInjection/Definition.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Definition.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ public function setConfigurator($configurator)
812812
/**
813813
* Gets the configurator to call after the service is fully initialized.
814814
*
815-
* @return callable|array|null
815+
* @return string|array|null
816816
*/
817817
public function getConfigurator()
818818
{

‎src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/ClosureLoader.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function __construct(ContainerBuilder $container, string $env = null)
3636
*/
3737
public function load($resource, string $type = null)
3838
{
39-
$resource($this->container, $this->env);
39+
return $resource($this->container, $this->env);
4040
}
4141

4242
/**

‎src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/DirectoryLoader.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function load($file, string $type = null)
3838
$this->import($dir, null, false, $path);
3939
}
4040
}
41+
42+
return null;
4143
}
4244

4345
/**

‎src/Symfony/Component/DependencyInjection/Loader/FileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/FileLoader.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function import($resource, string $type = null, $ignoreErrors = false, st
6363
}
6464

6565
try {
66-
parent::import(...$args);
66+
return parent::import(...$args);
6767
} catch (LoaderLoadException $e) {
6868
if (!$ignoreNotFound || !($prev = $e->getPrevious()) instanceof FileLocatorFileNotFoundException) {
6969
throw $e;
@@ -79,6 +79,8 @@ public function import($resource, string $type = null, $ignoreErrors = false, st
7979
throw $e;
8080
}
8181
}
82+
83+
return null;
8284
}
8385

8486
/**

‎src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/GlobFileLoader.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public function load($resource, string $type = null)
2828
}
2929

3030
$this->container->addResource($globResource);
31+
32+
return null;
3133
}
3234

3335
/**

‎src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/IniFileLoader.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public function load($resource, string $type = null)
5050
$this->container->setParameter($key, $this->phpize($value));
5151
}
5252
}
53+
54+
return null;
5355
}
5456

5557
/**

‎src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/PhpFileLoader.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public function load($resource, string $type = null)
7070
$this->instanceof = [];
7171
$this->registerAliasesForSinglyImplementedInterfaces();
7272
}
73+
74+
return null;
7375
}
7476

7577
/**

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ public function load($resource, string $type = null)
6666
}
6767
}
6868
}
69+
70+
return null;
6971
}
7072

7173
private function loadXml(\DOMDocument $xml, string $path, \DOMNode $root = null): void

‎src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function load($resource, string $type = null)
126126

127127
// empty file
128128
if (null === $content) {
129-
return;
129+
return null;
130130
}
131131

132132
$this->loadContent($content, $path);
@@ -145,6 +145,8 @@ public function load($resource, string $type = null)
145145
$this->env = $env;
146146
}
147147
}
148+
149+
return null;
148150
}
149151

150152
private function loadContent(array $content, string $path)

‎src/Symfony/Component/DomCrawler/Field/FormField.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DomCrawler/Field/FormField.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function getName()
8989
/**
9090
* Gets the value of the field.
9191
*
92-
* @return string|array The value of the field
92+
* @return string|array|null
9393
*/
9494
public function getValue()
9595
{

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function transform($value)
104104
*
105105
* @param string $value Percentage value
106106
*
107-
* @return int|float Normalized value
107+
* @return int|float|null
108108
*
109109
* @throws TransformationFailedException if the given value is not a string or
110110
* if the value could not be transformed

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ public function getScheme()
939939
*
940940
* The "X-Forwarded-Port" header must contain the client port.
941941
*
942-
* @return int|string can be a string if fetched from the server bag
942+
* @return int|string|null Can be a string if fetched from the server bag
943943
*/
944944
public function getPort()
945945
{

‎src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/MetadataBag.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public function getLastUsed()
139139
public function clear()
140140
{
141141
// nothing to do
142+
return null;
142143
}
143144

144145
/**

‎src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\HttpKernel\Event\ControllerEvent;
2323
use Symfony\Component\HttpKernel\Event\ResponseEvent;
2424
use Symfony\Component\HttpKernel\KernelEvents;
25+
use Symfony\Component\VarDumper\Cloner\Data;
2526

2627
/**
2728
* @author Fabien Potencier <fabien@symfony.com>
@@ -343,8 +344,8 @@ public function getRouteParams()
343344
/**
344345
* Gets the parsed controller.
345346
*
346-
* @return array|string The controller as a string or array of data
347-
* with keys 'class', 'method', 'file' and 'line'
347+
* @return array|string|Data The controller as a string or array of data
348+
* with keys 'class', 'method', 'file' and 'line'
348349
*/
349350
public function getController()
350351
{
@@ -354,8 +355,8 @@ public function getController()
354355
/**
355356
* Gets the previous request attributes.
356357
*
357-
* @return array|bool A legacy array of data from the previous redirection response
358-
* or false otherwise
358+
* @return array|Data|false A legacy array of data from the previous redirection response
359+
* or false otherwise
359360
*/
360361
public function getRedirect()
361362
{

‎src/Symfony/Component/HttpKernel/Profiler/Profile.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Profiler/Profile.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function setParent(self $parent)
7474
/**
7575
* Returns the parent profile.
7676
*
77-
* @return self
77+
* @return self|null
7878
*/
7979
public function getParent()
8080
{

‎src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Symfony\Component\HttpFoundation\Session\Session;
2323
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
2424
use Symfony\Component\HttpFoundation\Session\SessionInterface;
25+
use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag;
2526
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage;
2627
use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
2728
use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
@@ -268,6 +269,8 @@ public function testItCollectsTheSessionTraceProperly()
268269
$session = $this->createMock(SessionInterface::class);
269270
$session->method('getMetadataBag')->willReturnCallback(static function () use ($collector) {
270271
$collector->collectSessionUsage();
272+
273+
return new MetadataBag();
271274
});
272275
$session->getMetadataBag();
273276

‎src/Symfony/Component/HttpKernel/Tests/KernelTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Tests/KernelTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public function getNamespace(): string
522522
}
523523

524524
/**
525-
* @return false
525+
* @return string|false
526526
*/
527527
public function getXsdValidationBasePath()
528528
{

‎src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Ldap/Tests/Security/CheckLdapCredentialsListenerTest.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,12 @@ public function testBindFailureShouldThrowAnException()
147147

148148
public function testQueryForDn()
149149
{
150-
$collection = new \ArrayIterator([new Entry('')]);
150+
$collection = new class([new Entry('')]) extends \ArrayObject implements CollectionInterface {
151+
public function toArray(): array
152+
{
153+
return $this->getArrayCopy();
154+
}
155+
};
151156

152157
$query = $this->createMock(QueryInterface::class);
153158
$query->expects($this->once())->method('execute')->willReturn($collection);

‎src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Matcher/ExpressionLanguageProvider.php
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ public function __construct(ServiceProviderInterface $functions)
3434
*/
3535
public function getFunctions()
3636
{
37+
$functions = [];
38+
3739
foreach ($this->functions->getProvidedServices() as $function => $type) {
38-
yield new ExpressionFunction(
40+
$functions[] = new ExpressionFunction(
3941
$function,
4042
static function (...$args) use ($function) {
4143
return sprintf('($context->getParameter(\'_functions\')->get(%s)(%s))', var_export($function, true), implode(', ', $args));
@@ -45,6 +47,8 @@ function ($values, ...$args) use ($function) {
4547
}
4648
);
4749
}
50+
51+
return $functions;
4852
}
4953

5054
public function get(string $function): callable

‎src/Symfony/Component/Runtime/Tests/phpt/kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Runtime/Tests/phpt/kernel.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(string $var)
1515
$this->var = $var;
1616
}
1717

18-
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true)
18+
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true): Response
1919
{
2020
return new Response('OK Kernel '.$this->var);
2121
}

‎src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/AbstractAuthenticator.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ abstract class AbstractAuthenticator implements AuthenticatorInterface
2828
/**
2929
* Shortcut to create a PostAuthenticationToken for you, if you don't really
3030
* care about which authenticated token you're using.
31-
*
32-
* @return PostAuthenticationToken
3331
*/
3432
public function createToken(Passport $passport, string $firewallName): TokenInterface
3533
{

‎src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Http/Authenticator/Passport/PassportTrait.php
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ trait PassportTrait
2020
{
2121
private $badges = [];
2222

23+
/**
24+
* @return $this
25+
*/
2326
public function addBadge(BadgeInterface $badge): PassportInterface
2427
{
2528
$this->badges[\get_class($badge)] = $badge;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.