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

Commit00f08e4

Browse files
Add return types - batch 5/n
1 parent9004e35 commit00f08e4

File tree

105 files changed

+313
-363
lines changed

Some content is hidden

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

105 files changed

+313
-363
lines changed

‎src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php‎

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
9292
/**
9393
* {@inheritdoc}
9494
*/
95-
publicfunctiongetListeners(string$eventName =null)
95+
publicfunctiongetListeners(string$eventName =null):array
9696
{
9797
return$this->dispatcher->getListeners($eventName);
9898
}
9999

100100
/**
101101
* {@inheritdoc}
102102
*/
103-
publicfunctiongetListenerPriority(string$eventName,callable|array$listener)
103+
publicfunctiongetListenerPriority(string$eventName,callable|array$listener): ?int
104104
{
105105
// we might have wrapped listeners for the event (if called while dispatching)
106106
// in that case get the priority by wrapper
@@ -118,7 +118,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
118118
/**
119119
* {@inheritdoc}
120120
*/
121-
publicfunctionhasListeners(string$eventName =null)
121+
publicfunctionhasListeners(string$eventName =null):bool
122122
{
123123
return$this->dispatcher->hasListeners($eventName);
124124
}
@@ -163,10 +163,7 @@ public function dispatch(object $event, string $eventName = null): object
163163
return$event;
164164
}
165165

166-
/**
167-
* @return array
168-
*/
169-
publicfunctiongetCalledListeners(Request$request =null)
166+
publicfunctiongetCalledListeners(Request$request =null):array
170167
{
171168
if (null ===$this->callStack) {
172169
return [];
@@ -184,10 +181,7 @@ public function getCalledListeners(Request $request = null)
184181
return$called;
185182
}
186183

187-
/**
188-
* @return array
189-
*/
190-
publicfunctiongetNotCalledListeners(Request$request =null)
184+
publicfunctiongetNotCalledListeners(Request$request =null):array
191185
{
192186
try {
193187
$allListeners =$this->getListeners();
@@ -255,10 +249,8 @@ public function reset()
255249
*
256250
* @param string $method The method name
257251
* @param array $arguments The method arguments
258-
*
259-
* @return mixed
260252
*/
261-
publicfunction__call(string$method,array$arguments)
253+
publicfunction__call(string$method,array$arguments):mixed
262254
{
263255
return$this->dispatcher->{$method}(...$arguments);
264256
}

‎src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RegisterListenersPass implements CompilerPassInterface
3131
/**
3232
* @return $this
3333
*/
34-
publicfunctionsetHotPathEvents(array$hotPathEvents)
34+
publicfunctionsetHotPathEvents(array$hotPathEvents):static
3535
{
3636
$this->hotPathEvents =array_flip($hotPathEvents);
3737

@@ -41,7 +41,7 @@ public function setHotPathEvents(array $hotPathEvents)
4141
/**
4242
* @return $this
4343
*/
44-
publicfunctionsetNoPreloadEvents(array$noPreloadEvents):self
44+
publicfunctionsetNoPreloadEvents(array$noPreloadEvents):static
4545
{
4646
$this->noPreloadEvents =array_flip($noPreloadEvents);
4747

‎src/Symfony/Component/EventDispatcher/EventDispatcher.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function dispatch(object $event, string $eventName = null): object
6565
/**
6666
* {@inheritdoc}
6767
*/
68-
publicfunctiongetListeners(string$eventName =null)
68+
publicfunctiongetListeners(string$eventName =null):array
6969
{
7070
if (null !==$eventName) {
7171
if (empty($this->listeners[$eventName])) {
@@ -91,7 +91,7 @@ public function getListeners(string $eventName = null)
9191
/**
9292
* {@inheritdoc}
9393
*/
94-
publicfunctiongetListenerPriority(string$eventName,callable|array$listener)
94+
publicfunctiongetListenerPriority(string$eventName,callable|array$listener): ?int
9595
{
9696
if (empty($this->listeners[$eventName])) {
9797
returnnull;
@@ -120,7 +120,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
120120
/**
121121
* {@inheritdoc}
122122
*/
123-
publicfunctionhasListeners(string$eventName =null)
123+
publicfunctionhasListeners(string$eventName =null):bool
124124
{
125125
if (null !==$eventName) {
126126
return !empty($this->listeners[$eventName]);

‎src/Symfony/Component/EventDispatcher/EventDispatcherInterface.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber);
5050
*
5151
* @return array The event listeners for the specified event, or all event listeners by event name
5252
*/
53-
publicfunctiongetListeners(string$eventName =null);
53+
publicfunctiongetListeners(string$eventName =null):array;
5454

5555
/**
5656
* Gets the listener priority for a specific event.
@@ -59,12 +59,12 @@ public function getListeners(string $eventName = null);
5959
*
6060
* @return int|null The event listener priority
6161
*/
62-
publicfunctiongetListenerPriority(string$eventName,callable$listener);
62+
publicfunctiongetListenerPriority(string$eventName,callable$listener): ?int;
6363

6464
/**
6565
* Checks whether an event has any registered listeners.
6666
*
6767
* @return bool true if the specified event has any listeners, false otherwise
6868
*/
69-
publicfunctionhasListeners(string$eventName =null);
69+
publicfunctionhasListeners(string$eventName =null):bool;
7070
}

‎src/Symfony/Component/EventDispatcher/GenericEvent.php‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(mixed $subject = null, array $arguments = [])
4242
*
4343
* @return mixed The observer subject
4444
*/
45-
publicfunctiongetSubject()
45+
publicfunctiongetSubject():mixed
4646
{
4747
return$this->subject;
4848
}
@@ -54,7 +54,7 @@ public function getSubject()
5454
*
5555
* @throws \InvalidArgumentException if key is not found
5656
*/
57-
publicfunctiongetArgument(string$key)
57+
publicfunctiongetArgument(string$key):mixed
5858
{
5959
if ($this->hasArgument($key)) {
6060
return$this->arguments[$key];
@@ -68,7 +68,7 @@ public function getArgument(string $key)
6868
*
6969
* @return $this
7070
*/
71-
publicfunctionsetArgument(string$key,mixed$value)
71+
publicfunctionsetArgument(string$key,mixed$value):static
7272
{
7373
$this->arguments[$key] =$value;
7474

@@ -77,10 +77,8 @@ public function setArgument(string $key, mixed $value)
7777

7878
/**
7979
* Getter for all arguments.
80-
*
81-
* @return array
8280
*/
83-
publicfunctiongetArguments()
81+
publicfunctiongetArguments():array
8482
{
8583
return$this->arguments;
8684
}
@@ -90,7 +88,7 @@ public function getArguments()
9088
*
9189
* @return $this
9290
*/
93-
publicfunctionsetArguments(array$args = [])
91+
publicfunctionsetArguments(array$args = []):static
9492
{
9593
$this->arguments =$args;
9694

@@ -99,10 +97,8 @@ public function setArguments(array $args = [])
9997

10098
/**
10199
* Has argument.
102-
*
103-
* @return bool
104100
*/
105-
publicfunctionhasArgument(string$key)
101+
publicfunctionhasArgument(string$key):bool
106102
{
107103
return\array_key_exists($key,$this->arguments);
108104
}

‎src/Symfony/Component/EventDispatcher/ImmutableEventDispatcher.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,23 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
6868
/**
6969
* {@inheritdoc}
7070
*/
71-
publicfunctiongetListeners(string$eventName =null)
71+
publicfunctiongetListeners(string$eventName =null):array
7272
{
7373
return$this->dispatcher->getListeners($eventName);
7474
}
7575

7676
/**
7777
* {@inheritdoc}
7878
*/
79-
publicfunctiongetListenerPriority(string$eventName,callable|array$listener)
79+
publicfunctiongetListenerPriority(string$eventName,callable|array$listener): ?int
8080
{
8181
return$this->dispatcher->getListenerPriority($eventName,$listener);
8282
}
8383

8484
/**
8585
* {@inheritdoc}
8686
*/
87-
publicfunctionhasListeners(string$eventName =null)
87+
publicfunctionhasListeners(string$eventName =null):bool
8888
{
8989
return$this->dispatcher->hasListeners($eventName);
9090
}

‎src/Symfony/Component/ExpressionLanguage/Compiler.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function getFunction(string $name)
3838
*
3939
* @return string The PHP code
4040
*/
41-
publicfunctiongetSource()
41+
publicfunctiongetSource():string
4242
{
4343
return$this->source;
4444
}
@@ -55,7 +55,7 @@ public function reset()
5555
*
5656
* @return $this
5757
*/
58-
publicfunctioncompile(Node\Node$node)
58+
publicfunctioncompile(Node\Node$node):static
5959
{
6060
$node->compile($this);
6161

@@ -80,7 +80,7 @@ public function subcompile(Node\Node $node)
8080
*
8181
* @return $this
8282
*/
83-
publicfunctionraw(string$string)
83+
publicfunctionraw(string$string):static
8484
{
8585
$this->source .=$string;
8686

@@ -92,7 +92,7 @@ public function raw(string $string)
9292
*
9393
* @return $this
9494
*/
95-
publicfunctionstring(string$value)
95+
publicfunctionstring(string$value):static
9696
{
9797
$this->source .=sprintf('"%s"',addcslashes($value,"\0\t\"\$\\"));
9898

@@ -104,7 +104,7 @@ public function string(string $value)
104104
*
105105
* @return $this
106106
*/
107-
publicfunctionrepr(mixed$value)
107+
publicfunctionrepr(mixed$value):static
108108
{
109109
if (\is_int($value) ||\is_float($value)) {
110110
if (false !==$locale =setlocale(\LC_NUMERIC,0)) {

‎src/Symfony/Component/ExpressionLanguage/ExpressionFunction.php‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,17 @@ public function __construct(string $name, callable $compiler, callable $evaluato
4646
$this->evaluator =$evaluatorinstanceof \Closure ?$evaluator : \Closure::fromCallable($evaluator);
4747
}
4848

49-
/**
50-
* @return string
51-
*/
52-
publicfunctiongetName()
49+
publicfunctiongetName():string
5350
{
5451
return$this->name;
5552
}
5653

57-
/**
58-
* @return \Closure
59-
*/
60-
publicfunctiongetCompiler()
54+
publicfunctiongetCompiler():\Closure
6155
{
6256
return$this->compiler;
6357
}
6458

65-
/**
66-
* @return \Closure
67-
*/
68-
publicfunctiongetEvaluator()
59+
publicfunctiongetEvaluator():\Closure
6960
{
7061
return$this->evaluator;
7162
}
@@ -75,13 +66,11 @@ public function getEvaluator()
7566
*
7667
* @param string|null $expressionFunctionName The expression function name (default: same than the PHP function name)
7768
*
78-
* @return self
79-
*
8069
* @throws \InvalidArgumentException if given PHP function name does not exist
8170
* @throws \InvalidArgumentException if given PHP function name is in namespace
8271
* and expression function name is not defined
8372
*/
84-
publicstaticfunctionfromPhp(string$phpFunctionName,string$expressionFunctionName =null)
73+
publicstaticfunctionfromPhp(string$phpFunctionName,string$expressionFunctionName =null):self
8574
{
8675
$phpFunctionName =ltrim($phpFunctionName,'\\');
8776
if (!\function_exists($phpFunctionName)) {

‎src/Symfony/Component/ExpressionLanguage/ExpressionLanguage.php‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(CacheItemPoolInterface $cache = null, array $provide
4848
*
4949
* @return string The compiled PHP source code
5050
*/
51-
publicfunctioncompile(Expression|string$expression,array$names = [])
51+
publicfunctioncompile(Expression|string$expression,array$names = []):string
5252
{
5353
return$this->getCompiler()->compile($this->parse($expression,$names)->getNodes())->getSource();
5454
}
@@ -58,17 +58,15 @@ public function compile(Expression|string $expression, array $names = [])
5858
*
5959
* @return mixed The result of the evaluation of the expression
6060
*/
61-
publicfunctionevaluate(Expression|string$expression,array$values = [])
61+
publicfunctionevaluate(Expression|string$expression,array$values = []):mixed
6262
{
6363
return$this->parse($expression,array_keys($values))->getNodes()->evaluate($this->functions,$values);
6464
}
6565

6666
/**
6767
* Parses an expression.
68-
*
69-
* @return ParsedExpression
7068
*/
71-
publicfunctionparse(Expression|string$expression,array$names)
69+
publicfunctionparse(Expression|string$expression,array$names):ParsedExpression
7270
{
7371
if ($expressioninstanceof ParsedExpression) {
7472
return$expression;

‎src/Symfony/Component/ExpressionLanguage/Lexer.php‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ class Lexer
2121
/**
2222
* Tokenizes an expression.
2323
*
24-
* @return TokenStream
25-
*
2624
* @throws SyntaxError
2725
*/
28-
publicfunctiontokenize(string$expression)
26+
publicfunctiontokenize(string$expression):TokenStream
2927
{
3028
$expression =str_replace(["\r","\n","\t","\v","\f"],'',$expression);
3129
$cursor =0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp