Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc10131d

Browse files
[DependencyInjection] add union types
1 parent76ee4a5 commitc10131d

File tree

74 files changed

+153
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+153
-395
lines changed

‎src/Symfony/Component/DependencyInjection/Argument/BoundArgument.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class BoundArgument implements ArgumentInterface
2828
private$type;
2929
private$file;
3030

31-
publicfunction__construct($value,bool$trackUsage =true,int$type =0,string$file =null)
31+
publicfunction__construct(mixed$value,bool$trackUsage =true,int$type =0,string$file =null)
3232
{
3333
$this->value =$value;
3434
if ($trackUsage) {

‎src/Symfony/Component/DependencyInjection/Argument/RewindableGenerator.php‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ class RewindableGenerator implements \IteratorAggregate, \Countable
1919
private$generator;
2020
private$count;
2121

22-
/**
23-
* @param int|callable $count
24-
*/
25-
publicfunction__construct(callable$generator,$count)
22+
publicfunction__construct(callable$generator,int|callable$count)
2623
{
2724
$this->generator =$generator;
2825
$this->count =$count;

‎src/Symfony/Component/DependencyInjection/Argument/ServiceLocator.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(\Closure $factory, array $serviceMap, array $service
3737
*
3838
* @return mixed
3939
*/
40-
publicfunctionget($id)
40+
publicfunctionget(string$id)
4141
{
4242
returnisset($this->serviceMap[$id]) ? ($this->factory)(...$this->serviceMap[$id]) :parent::get($id);
4343
}

‎src/Symfony/Component/DependencyInjection/Argument/ServiceLocatorArgument.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ServiceLocatorArgument implements ArgumentInterface
2727
/**
2828
* @param Reference[]|TaggedIteratorArgument $values
2929
*/
30-
publicfunction__construct($values = [])
30+
publicfunction__construct(array|TaggedIteratorArgument$values = [])
3131
{
3232
if ($valuesinstanceof TaggedIteratorArgument) {
3333
$this->taggedIteratorArgument =$values;

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

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ public function getParent()
4444
/**
4545
* Sets the Definition to inherit from.
4646
*
47-
* @param string $parent
48-
*
4947
* @return $this
5048
*/
51-
publicfunctionsetParent($parent)
49+
publicfunctionsetParent(string$parent)
5250
{
5351
$this->parent =$parent;
5452

@@ -61,13 +59,11 @@ public function setParent($parent)
6159
* If replaceArgument() has been used to replace an argument, this method
6260
* will return the replacement value.
6361
*
64-
* @param int|string $index
65-
*
6662
* @return mixed The argument value
6763
*
6864
* @throws OutOfBoundsException When the argument does not exist
6965
*/
70-
publicfunctiongetArgument($index)
66+
publicfunctiongetArgument(int|string$index)
7167
{
7268
if (\array_key_exists('index_'.$index,$this->arguments)) {
7369
return$this->arguments['index_'.$index];
@@ -84,14 +80,11 @@ public function getArgument($index)
8480
* certain conventions when you want to overwrite the arguments of the
8581
* parent definition, otherwise your arguments will only be appended.
8682
*
87-
* @param int|string $index
88-
* @param mixed $value
89-
*
9083
* @return $this
9184
*
9285
* @throws InvalidArgumentException when $index isn't an integer
9386
*/
94-
publicfunctionreplaceArgument($index,$value)
87+
publicfunctionreplaceArgument(int|string$index,mixed$value)
9588
{
9689
if (\is_int($index)) {
9790
$this->arguments['index_'.$index] =$value;

‎src/Symfony/Component/DependencyInjection/Compiler/AbstractRecursivePass.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,9 @@ protected function inExpression(bool $reset = true): bool
6767
/**
6868
* Processes a value found in a definition tree.
6969
*
70-
* @param mixed $value
71-
*
7270
* @return mixed The processed value
7371
*/
74-
protectedfunctionprocessValue($value,bool$isRoot =false)
72+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
7573
{
7674
if (\is_array($value)) {
7775
foreach ($valueas$k =>$v) {

‎src/Symfony/Component/DependencyInjection/Compiler/AliasDeprecatedPublicServicesPass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(string $tagName = 'container.private')
3333
/**
3434
* {@inheritdoc}
3535
*/
36-
protectedfunctionprocessValue($value,bool$isRoot =false)
36+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
3737
{
3838
if ($valueinstanceof Reference &&isset($this->aliases[$id = (string)$value])) {
3939
returnnewReference($this->aliases[$id],$value->getInvalidBehavior());

‎src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function process(ContainerBuilder $container)
7676
}
7777
}
7878

79-
protectedfunctionprocessValue($value,bool$isRoot =false)
79+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
8080
{
8181
$lazy =$this->lazy;
8282
$inExpression =$this->inExpression();

‎src/Symfony/Component/DependencyInjection/Compiler/AttributeAutoconfigurationPass.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function process(ContainerBuilder $container): void
2929
parent::process($container);
3030
}
3131

32-
protectedfunctionprocessValue($value,bool$isRoot =false)
32+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
3333
{
3434
if (!$valueinstanceof Definition
3535
|| !$value->isAutoconfigured()

‎src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function process(ContainerBuilder $container)
7272
/**
7373
* {@inheritdoc}
7474
*/
75-
protectedfunctionprocessValue($value,bool$isRoot =false)
75+
protectedfunctionprocessValue(mixed$value,bool$isRoot =false)
7676
{
7777
try {
7878
return$this->doProcessValue($value,$isRoot);
@@ -87,10 +87,7 @@ protected function processValue($value, bool $isRoot = false)
8787
}
8888
}
8989

90-
/**
91-
* @return mixed
92-
*/
93-
privatefunctiondoProcessValue($value,bool$isRoot =false)
90+
privatefunctiondoProcessValue(mixed$value,bool$isRoot =false):mixed
9491
{
9592
if ($valueinstanceof TypedReference) {
9693
if ($ref =$this->getAutowiredReference($value)) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp