Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c2c9d2e

Browse files
More return type fixes (bis)
1 parent 488a46f commit c2c9d2e

File tree

19 files changed

+38
-14
lines changed

19 files changed

+38
-14
lines changed

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

Lines 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/Bundle/FrameworkBundle/CacheWarmer/AbstractPhpFileCacheWarmer.php

Lines 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/Translation/Translator.php

Lines 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

Lines 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/DependencyInjection/Definition.php

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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/HttpKernel/Tests/KernelTest.php

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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)