Skip to content

Commit 4b562db

Browse files
Merge branch '4.4' into 5.1
* 4.4: Add missing `@return` annotations to fix deprecations on PHP 8 [ProxyManagerBridge] fix PHP notice, switch to "friendsofphp/proxy-manager-lts"
2 parents fc3b9cd + 46c4bcd commit 4b562db

27 files changed

+78
-2
lines changed

Argument/ServiceLocator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function __construct(\Closure $factory, array $serviceMap, array $service
3434

3535
/**
3636
* {@inheritdoc}
37+
*
38+
* @return mixed
3739
*/
3840
public function get($id)
3941
{

Container.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function getParameterBag()
109109
*
110110
* @param string $name The parameter name
111111
*
112-
* @return mixed The parameter value
112+
* @return array|bool|float|int|string|null The parameter value
113113
*
114114
* @throws InvalidArgumentException if the parameter is not defined
115115
*/

ContainerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function initialized(string $id);
7171
*
7272
* @param string $name The parameter name
7373
*
74-
* @return mixed The parameter value
74+
* @return array|bool|float|int|string|null The parameter value
7575
*
7676
* @throws InvalidArgumentException if the parameter is not defined
7777
*/

Dumper/PhpDumper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,9 @@ private function addDefaultParametersMethod(): string
15121512

15131513
$code = <<<'EOF'
15141514
1515+
/**
1516+
* @return array|bool|float|int|string|null
1517+
*/
15151518
public function getParameter(string $name)
15161519
{
15171520
if (isset($this->buildParameters[$name])) {

ServiceLocator.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ class ServiceLocator implements ServiceProviderInterface
3333
private $externalId;
3434
private $container;
3535

36+
/**
37+
* {@inheritdoc}
38+
*
39+
* @return mixed
40+
*/
3641
public function get($id)
3742
{
3843
if (!$this->externalId) {

Tests/Compiler/IntegrationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,9 @@ public function __construct(ServiceLocator $locator)
537537
$this->locator = $locator;
538538
}
539539

540+
/**
541+
* @return mixed
542+
*/
540543
public function get($id)
541544
{
542545
return $this->locator->get($id);

Tests/Fixtures/php/services10.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ protected function getTestService()
5656
return $this->services['test'] = new \stdClass(['only dot' => '.', 'concatenation as value' => '.\'\'.', 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => 'string1-string2', 'optimize concatenation with empty string' => 'string1string2', 'optimize concatenation from the start' => 'start', 'optimize concatenation at the end' => 'end', 'new line' => 'string with '."\n".'new line']);
5757
}
5858

59+
/**
60+
* @return array|bool|float|int|string|null
61+
*/
5962
public function getParameter(string $name)
6063
{
6164
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || \array_key_exists($name, $this->parameters))) {

Tests/Fixtures/php/services12.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ protected function getTestService()
5656
return $this->services['test'] = new \stdClass(('file://'.\dirname(__DIR__, 1)), [('file://'.\dirname(__DIR__, 1)) => (\dirname(__DIR__, 2).'/')]);
5757
}
5858

59+
/**
60+
* @return array|bool|float|int|string|null
61+
*/
5962
public function getParameter(string $name)
6063
{
6164
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || \array_key_exists($name, $this->parameters))) {

Tests/Fixtures/php/services19.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ protected function getServiceWithMethodCallAndFactoryService()
7171
return $instance;
7272
}
7373

74+
/**
75+
* @return array|bool|float|int|string|null
76+
*/
7477
public function getParameter(string $name)
7578
{
7679
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || \array_key_exists($name, $this->parameters))) {

Tests/Fixtures/php/services26.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ protected function getTestService()
6767
return $this->services['test'] = new ${($_ = $this->getEnv('FOO')) && false ?: "_"}($this->getEnv('Bar'), 'foo'.$this->getEnv('string:FOO').'baz', $this->getEnv('int:Baz'));
6868
}
6969

70+
/**
71+
* @return array|bool|float|int|string|null
72+
*/
7073
public function getParameter(string $name)
7174
{
7275
if (!(isset($this->parameters[$name]) || isset($this->loadedDynamicParameters[$name]) || \array_key_exists($name, $this->parameters))) {

0 commit comments

Comments
 (0)