Skip to content

Commit a34f04c

Browse files
Add return types to internal|final|private methods
1 parent c6c7891 commit a34f04c

File tree

7 files changed

+12
-22
lines changed

7 files changed

+12
-22
lines changed

ContainerBuilder.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,23 +1496,19 @@ public function log(CompilerPassInterface $pass, string $message)
14961496
/**
14971497
* Gets removed binding ids.
14981498
*
1499-
* @return array
1500-
*
15011499
* @internal
15021500
*/
1503-
public function getRemovedBindingIds()
1501+
public function getRemovedBindingIds(): array
15041502
{
15051503
return $this->removedBindingIds;
15061504
}
15071505

15081506
/**
15091507
* Removes bindings for a service.
15101508
*
1511-
* @param string $id The service identifier
1512-
*
15131509
* @internal
15141510
*/
1515-
public function removeBindings($id)
1511+
public function removeBindings(string $id)
15161512
{
15171513
if ($this->hasDefinition($id)) {
15181514
foreach ($this->getDefinition($id)->getBindings() as $key => $binding) {
@@ -1527,11 +1523,9 @@ public function removeBindings($id)
15271523
*
15281524
* @param mixed $value An array of conditionals to return
15291525
*
1530-
* @return array An array of Service conditionals
1531-
*
15321526
* @internal
15331527
*/
1534-
public static function getServiceConditionals($value)
1528+
public static function getServiceConditionals($value): array
15351529
{
15361530
$services = [];
15371531

@@ -1551,11 +1545,9 @@ public static function getServiceConditionals($value)
15511545
*
15521546
* @param mixed $value An array of conditionals to return
15531547
*
1554-
* @return array An array of uninitialized conditionals
1555-
*
15561548
* @internal
15571549
*/
1558-
public static function getInitializedConditionals($value)
1550+
public static function getInitializedConditionals($value): array
15591551
{
15601552
$services = [];
15611553

LazyProxy/PhpDumper/NullDumper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ class NullDumper implements DumperInterface
2525
/**
2626
* {@inheritdoc}
2727
*/
28-
public function isProxyCandidate(Definition $definition)
28+
public function isProxyCandidate(Definition $definition): bool
2929
{
3030
return false;
3131
}
3232

3333
/**
3434
* {@inheritdoc}
3535
*/
36-
public function getProxyFactoryCode(Definition $definition, $id, $factoryCode = null)
36+
public function getProxyFactoryCode(Definition $definition, $id, $factoryCode = null): string
3737
{
3838
return '';
3939
}
4040

4141
/**
4242
* {@inheritdoc}
4343
*/
44-
public function getProxyCode(Definition $definition)
44+
public function getProxyCode(Definition $definition): string
4545
{
4646
return '';
4747
}

LazyProxy/ProxyHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ProxyHelper
2121
/**
2222
* @return string|null The FQCN or builtin name of the type hint, or null when the type hint references an invalid self|parent context
2323
*/
24-
public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, $noBuiltin = false)
24+
public static function getTypeHint(\ReflectionFunctionAbstract $r, \ReflectionParameter $p = null, $noBuiltin = false): ?string
2525
{
2626
if ($p instanceof \ReflectionParameter) {
2727
$type = $p->getType();

Loader/Configurator/DefaultsConfigurator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,8 @@ final public function tag(string $name, array $attributes = [])
6161

6262
/**
6363
* Defines an instanceof-conditional to be applied to following service definitions.
64-
*
65-
* @return InstanceofConfigurator
6664
*/
67-
final public function instanceof(string $fqcn)
65+
final public function instanceof(string $fqcn): InstanceofConfigurator
6866
{
6967
return $this->parent->instanceof($fqcn);
7068
}

Tests/Compiler/CustomExpressionLanguageFunctionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testDump()
1919
->setArguments([new Expression('custom_func("foobar")')]);
2020

2121
$container->addExpressionLanguageProvider(new class() implements ExpressionFunctionProviderInterface {
22-
public function getFunctions()
22+
public function getFunctions(): array
2323
{
2424
return [
2525
ExpressionFunction::fromPhp('strtolower', 'custom_func'),

Tests/Compiler/RegisterServiceSubscribersPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function testServiceSubscriberWithSemanticId()
196196
$container = new ContainerBuilder();
197197

198198
$subscriber = new class() implements ServiceSubscriberInterface {
199-
public static function getSubscribedServices()
199+
public static function getSubscribedServices(): array
200200
{
201201
return [
202202
'some.service' => 'stdClass',

Tests/ContainerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testReset()
327327
$c->set('bar', $bar = new class() implements ResetInterface {
328328
public $resetCounter = 0;
329329

330-
public function reset()
330+
public function reset(): void
331331
{
332332
++$this->resetCounter;
333333
}

0 commit comments

Comments
 (0)