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

Appearance settings

Commit 4ff47df

Browse filesBrowse files
Narrow existing return types on private/internal/final/test methods
1 parent 033db6e commit 4ff47df
Copy full SHA for 4ff47df

File tree

174 files changed

+269
-978
lines changed
Filter options

Some content is hidden

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

174 files changed

+269
-978
lines changed

‎src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/IdGenerator/UuidGenerator.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ public function nameBased(string $entityGetter, Uuid|string $namespace = null):
4949
return $clone;
5050
}
5151

52-
/**
53-
* @return static
54-
*/
55-
public function randomBased(): self
52+
public function randomBased(): static
5653
{
5754
$clone = clone $this;
5855
$clone->factory = $clone->protoFactory->randomBased();

‎src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Mime/WrappedTemplatedEmail.php
+8-32Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ public function attach(string $file, string $name = null, string $contentType =
5757
}
5858
}
5959

60-
/**
61-
* @return $this
62-
*/
63-
public function setSubject(string $subject): self
60+
public function setSubject(string $subject): static
6461
{
6562
$this->message->subject($subject);
6663

@@ -72,10 +69,7 @@ public function getSubject(): ?string
7269
return $this->message->getSubject();
7370
}
7471

75-
/**
76-
* @return $this
77-
*/
78-
public function setReturnPath(string $address): self
72+
public function setReturnPath(string $address): static
7973
{
8074
$this->message->returnPath($address);
8175

@@ -87,10 +81,7 @@ public function getReturnPath(): string
8781
return $this->message->getReturnPath();
8882
}
8983

90-
/**
91-
* @return $this
92-
*/
93-
public function addFrom(string $address, string $name = ''): self
84+
public function addFrom(string $address, string $name = ''): static
9485
{
9586
$this->message->addFrom(new Address($address, $name));
9687

@@ -105,10 +96,7 @@ public function getFrom(): array
10596
return $this->message->getFrom();
10697
}
10798

108-
/**
109-
* @return $this
110-
*/
111-
public function addReplyTo(string $address): self
99+
public function addReplyTo(string $address): static
112100
{
113101
$this->message->addReplyTo($address);
114102

@@ -123,10 +111,7 @@ public function getReplyTo(): array
123111
return $this->message->getReplyTo();
124112
}
125113

126-
/**
127-
* @return $this
128-
*/
129-
public function addTo(string $address, string $name = ''): self
114+
public function addTo(string $address, string $name = ''): static
130115
{
131116
$this->message->addTo(new Address($address, $name));
132117

@@ -141,10 +126,7 @@ public function getTo(): array
141126
return $this->message->getTo();
142127
}
143128

144-
/**
145-
* @return $this
146-
*/
147-
public function addCc(string $address, string $name = ''): self
129+
public function addCc(string $address, string $name = ''): static
148130
{
149131
$this->message->addCc(new Address($address, $name));
150132

@@ -159,10 +141,7 @@ public function getCc(): array
159141
return $this->message->getCc();
160142
}
161143

162-
/**
163-
* @return $this
164-
*/
165-
public function addBcc(string $address, string $name = ''): self
144+
public function addBcc(string $address, string $name = ''): static
166145
{
167146
$this->message->addBcc(new Address($address, $name));
168147

@@ -177,10 +156,7 @@ public function getBcc(): array
177156
return $this->message->getBcc();
178157
}
179158

180-
/**
181-
* @return $this
182-
*/
183-
public function setPriority(int $priority): self
159+
public function setPriority(int $priority): static
184160
{
185161
$this->message->priority($priority);
186162

‎src/Symfony/Component/Console/Command/LazyCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/LazyCommand.php
+7-28Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ public function run(InputInterface $input, OutputInterface $output): int
6969
return $this->getCommand()->run($input, $output);
7070
}
7171

72-
/**
73-
* @return $this
74-
*/
75-
public function setCode(callable $code): self
72+
public function setCode(callable $code): static
7673
{
7774
$this->getCommand()->setCode($code);
7875

@@ -87,10 +84,7 @@ public function mergeApplicationDefinition(bool $mergeArgs = true): void
8784
$this->getCommand()->mergeApplicationDefinition($mergeArgs);
8885
}
8986

90-
/**
91-
* @return $this
92-
*/
93-
public function setDefinition(array|InputDefinition $definition): self
87+
public function setDefinition(array|InputDefinition $definition): static
9488
{
9589
$this->getCommand()->setDefinition($definition);
9690

@@ -107,40 +101,28 @@ public function getNativeDefinition(): InputDefinition
107101
return $this->getCommand()->getNativeDefinition();
108102
}
109103

110-
/**
111-
* @return $this
112-
*/
113-
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): self
104+
public function addArgument(string $name, int $mode = null, string $description = '', mixed $default = null): static
114105
{
115106
$this->getCommand()->addArgument($name, $mode, $description, $default);
116107

117108
return $this;
118109
}
119110

120-
/**
121-
* @return $this
122-
*/
123-
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): self
111+
public function addOption(string $name, string|array $shortcut = null, int $mode = null, string $description = '', mixed $default = null): static
124112
{
125113
$this->getCommand()->addOption($name, $shortcut, $mode, $description, $default);
126114

127115
return $this;
128116
}
129117

130-
/**
131-
* @return $this
132-
*/
133-
public function setProcessTitle(string $title): self
118+
public function setProcessTitle(string $title): static
134119
{
135120
$this->getCommand()->setProcessTitle($title);
136121

137122
return $this;
138123
}
139124

140-
/**
141-
* @return $this
142-
*/
143-
public function setHelp(string $help): self
125+
public function setHelp(string $help): static
144126
{
145127
$this->getCommand()->setHelp($help);
146128

@@ -162,10 +144,7 @@ public function getSynopsis(bool $short = false): string
162144
return $this->getCommand()->getSynopsis($short);
163145
}
164146

165-
/**
166-
* @return $this
167-
*/
168-
public function addUsage(string $usage): self
147+
public function addUsage(string $usage): static
169148
{
170149
$this->getCommand()->addUsage($usage);
171150

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/ContainerConfigurator.php
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@ final public function env(): ?string
8282
return $this->env;
8383
}
8484

85-
/**
86-
* @return static
87-
*/
88-
final public function withPath(string $path): self
85+
final public function withPath(string $path): static
8986
{
9087
$clone = clone $this;
9188
$clone->path = $clone->file = $path;

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/DefaultsConfigurator.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ public function __construct(ServicesConfigurator $parent, Definition $definition
3838
/**
3939
* Adds a tag for this definition.
4040
*
41-
* @return $this
42-
*
4341
* @throws InvalidArgumentException when an invalid tag name or attribute is provided
4442
*/
45-
final public function tag(string $name, array $attributes = []): self
43+
final public function tag(string $name, array $attributes = []): static
4644
{
4745
if ('' === $name) {
4846
throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/ParametersConfigurator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/ParametersConfigurator.php
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,14 @@ public function __construct(ContainerBuilder $container)
2727
$this->container = $container;
2828
}
2929

30-
/**
31-
* @return $this
32-
*/
33-
final public function set(string $name, mixed $value): self
30+
final public function set(string $name, mixed $value): static
3431
{
3532
$this->container->setParameter($name, static::processValue($value, true));
3633

3734
return $this;
3835
}
3936

40-
/**
41-
* @return $this
42-
*/
43-
final public function __invoke(string $name, mixed $value): self
37+
final public function __invoke(string $name, mixed $value): static
4438
{
4539
return $this->set($name, $value);
4640
}

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/PrototypeConfigurator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/PrototypeConfigurator.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ public function __destruct()
7575
* Excludes files from registration using glob patterns.
7676
*
7777
* @param string[]|string $excludes
78-
*
79-
* @return $this
8078
*/
81-
final public function exclude(array|string $excludes): self
79+
final public function exclude(array|string $excludes): static
8280
{
8381
$this->excludes = (array) $excludes;
8482

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/ReferenceConfigurator.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/ReferenceConfigurator.php
+3-12Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,30 +29,21 @@ public function __construct(string $id)
2929
$this->id = $id;
3030
}
3131

32-
/**
33-
* @return $this
34-
*/
35-
final public function ignoreOnInvalid(): self
32+
final public function ignoreOnInvalid(): static
3633
{
3734
$this->invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
3835

3936
return $this;
4037
}
4138

42-
/**
43-
* @return $this
44-
*/
45-
final public function nullOnInvalid(): self
39+
final public function nullOnInvalid(): static
4640
{
4741
$this->invalidBehavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
4842

4943
return $this;
5044
}
5145

52-
/**
53-
* @return $this
54-
*/
55-
final public function ignoreOnUninitialized(): self
46+
final public function ignoreOnUninitialized(): static
5647
{
5748
$this->invalidBehavior = ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE;
5849

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AbstractTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AbstractTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ trait AbstractTrait
1616
/**
1717
* Whether this definition is abstract, that means it merely serves as a
1818
* template for other definitions.
19-
*
20-
* @return $this
2119
*/
22-
final public function abstract(bool $abstract = true): self
20+
final public function abstract(bool $abstract = true): static
2321
{
2422
$this->definition->setAbstract($abstract);
2523

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/ArgumentTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/ArgumentTrait.php
+2-6Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ trait ArgumentTrait
1515
{
1616
/**
1717
* Sets the arguments to pass to the service constructor/factory method.
18-
*
19-
* @return $this
2018
*/
21-
final public function args(array $arguments): self
19+
final public function args(array $arguments): static
2220
{
2321
$this->definition->setArguments(static::processValue($arguments, true));
2422

@@ -27,10 +25,8 @@ final public function args(array $arguments): self
2725

2826
/**
2927
* Sets one argument to pass to the service constructor/factory method.
30-
*
31-
* @return $this
3228
*/
33-
final public function arg(string|int $key, mixed $value): self
29+
final public function arg(string|int $key, mixed $value): static
3430
{
3531
$this->definition->setArgument($key, static::processValue($value, true));
3632

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AutoconfigureTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AutoconfigureTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ trait AutoconfigureTrait
1818
/**
1919
* Sets whether or not instanceof conditionals should be prepended with a global set.
2020
*
21-
* @return $this
22-
*
2321
* @throws InvalidArgumentException when a parent is already set
2422
*/
25-
final public function autoconfigure(bool $autoconfigured = true): self
23+
final public function autoconfigure(bool $autoconfigured = true): static
2624
{
2725
$this->definition->setAutoconfigured($autoconfigured);
2826

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AutowireTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/AutowireTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ trait AutowireTrait
1515
{
1616
/**
1717
* Enables/disables autowiring.
18-
*
19-
* @return $this
2018
*/
21-
final public function autowire(bool $autowired = true): self
19+
final public function autowire(bool $autowired = true): static
2220
{
2321
$this->definition->setAutowired($autowired);
2422

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/BindTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/BindTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ trait BindTrait
2828
*
2929
* @param string $nameOrFqcn A parameter name with its "$" prefix, or an FQCN
3030
* @param mixed $valueOrRef The value or reference to bind
31-
*
32-
* @return $this
3331
*/
34-
final public function bind(string $nameOrFqcn, mixed $valueOrRef): self
32+
final public function bind(string $nameOrFqcn, mixed $valueOrRef): static
3533
{
3634
$valueOrRef = static::processValue($valueOrRef, true);
3735
if (!preg_match('/^(?:(?:array|bool|float|int|string|iterable)[ \t]*+)?\$/', $nameOrFqcn) && !$valueOrRef instanceof Reference) {

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/CallTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@ trait CallTrait
2222
* @param array $arguments An array of arguments to pass to the method call
2323
* @param bool $returnsClone Whether the call returns the service instance or not
2424
*
25-
* @return $this
26-
*
2725
* @throws InvalidArgumentException on empty $method param
2826
*/
29-
final public function call(string $method, array $arguments = [], bool $returnsClone = false): self
27+
final public function call(string $method, array $arguments = [], bool $returnsClone = false): static
3028
{
3129
$this->definition->addMethodCall($method, static::processValue($arguments, true), $returnsClone);
3230

‎src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/ClassTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/ClassTrait.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ trait ClassTrait
1515
{
1616
/**
1717
* Sets the service class.
18-
*
19-
* @return $this
2018
*/
21-
final public function class(?string $class): self
19+
final public function class(?string $class): static
2220
{
2321
$this->definition->setClass($class);
2422

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.