10000 Add missing void return types · symfony/symfony@2d98e28 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2d98e28

Browse files
committed
Add missing void return types
1 parent 168f04a commit 2d98e28

File tree

17 files changed

+227
-34
lines changed

17 files changed

+227
-34
lines changed

.github/expected-missing-return-types.diff

Lines changed: 184 additions & 28 deletions
Large diffs are not rendered by default.

src/Symfony/Component/Console/Output/OutputInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public function isDebug(): bool;
8585

8686
/**
8787
* Sets the decorated flag.
88+
*
89+
* @return void
8890
*/
8991
public function setDecorated(bool $decorated);
9092

src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ interface ViolationMapperInterface
2424
* the given form.
2525
*
2626
* @param bool $allowNonSynchronized Whether to allow mapping to non-synchronized forms
27+
*
28+
* @return void
2729
*/
2830
public function mapViolation(ConstraintViolation $violation, FormInterface $form, bool $allowNonSynchronized = false);
2931
}

src/Symfony/Component/Intl/Data/Bundle/Compiler/BundleCompilerInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ interface BundleCompilerInterface
2323
/**
2424
* Compiles a resource bundle at the given source to the given target
2525
* directory.
26+
*
27+
* @return void
2628
*/
2729
public function compile(string $sourcePath, string $targetDir);
2830
}

src/Symfony/Component/Intl/Data/Bundle/Writer/BundleWriterInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,8 @@
2020
*/
2121
interface BundleWriterInterface
2222
{
23+
/**
24+
* @return void
25+
*/
2326
public function write(string $path, string $locale, mixed $data);
2427
}

src/Symfony/Component/Ldap/Adapter/ConnectionInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function isBound(): bool;
3131
* @throws AlreadyExistsException When the connection can't be created because of an LDAP_ALREADY_EXISTS error
3232
* @throws ConnectionTimeoutException When the connection can't be created because of an LDAP_TIMEOUT error
3333
* @throws InvalidCredentialsException When the connection can't be created because of an LDAP_INVALID_CREDENTIALS error
34+
*
35+
* @return void
3436
*/
3537
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null);
3638
}

src/Symfony/Component/Ldap/LdapInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ interface LdapInterface
2929
* Return a connection bound to the ldap.
3030
*
3131
* @throws ConnectionException if dn / password could not be bound
32+
*
33+
* @return void
3234
*/
3335
public function bind(string $dn = null, #[\SensitiveParameter] string $password = null);
3436

src/Symfony/Component/Mime/Header/HeaderInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ interface HeaderInterface
2222
* Sets the body.
2323
*
2424
* The type depends on the Header concrete class.
25+
*
26+
* @return void
2527
*/
2628
public function setBody(mixed $body);
2729

@@ -32,16 +34,25 @@ public function setBody(mixed $body);
3234
*/
3335
public function getBody(): mixed;
3436

37+
/**
38+
* @return void
39+
*/
3540
public function setCharset(string $charset);
3641

3742
public function getCharset(): ?string;
3843

44+
/**
45+
* @return void
46+
*/
3947
public function setLanguage(string $lang);
4048

4149
public function getLanguage(): ?string;
4250

4351
public function getName(): string;
4452

53+
/**
54+
* @return void
55+
*/
4556
public function setMaxLineLength(int $lineLength);
4657

4758
public function getMaxLineLength(): int;

src/Symfony/Component/PropertyAccess/PropertyAccessorInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ interface PropertyAccessorInterface
4242
* @throws Exception\InvalidArgumentException If the property path is invalid
4343
* @throws Exception\AccessException If a property/index does not exist or is not public
4444
* @throws Exception\UnexpectedTypeException If a value within the path is neither object nor array
45+
*
46+
* @return void
45 10000 47
*/
4648
public function setValue(object|array &$objectOrArray, string|PropertyPathInterface $propertyPath, mixed $value);
4749

src/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ interface ConfigurableRequirementsInterface
4040
/**
4141
* Enables or disables the exception on incorrect parameters.
4242
* Passing null will deactivate the requirements check completely.
43+
*
44+
* @return void
4345
*/
4446
public function setStrictRequirements(?bool $enabled);
4547

src/Symfony/Component/Routing/RequestContextAwareInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ interface RequestContextAwareInterface
1515
{
1616
/**
1717
* Sets the request context.
18+
*
19+
* @return void
1820
*/
1921
public function setContext(RequestContext $context);
2022

src/Symfony/Component/Serializer/Normalizer/DenormalizableInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ interface DenormalizableInterface
3333
* @param string|null $format The format is optionally given to be able to denormalize
3434
* differently based on different input formats
3535
* @param array $context Options for denormalizing
36+
*
37+
* @return void
3638
*/
3739
public function denormalize(DenormalizerInterface $denormalizer, array|string|int|float|bool $data, string $format = null, array $context = []);
3840
}

src/Symfony/Component/Serializer/Tests/Fixtures/Dummy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function normalize(NormalizerInterface $normalizer, string $format = null
3333
];
3434
}
3535

36-
public function denormalize(DenormalizerInterface $denormalizer, array|string|int|float|bool $data, string $format = null, array $context = [])
36+
public function denormalize(DenormalizerInterface $denormalizer, array|string|int|float|bool $data, string $format = null, array $context = []): void
3737
{
3838
$this->foo = $data['foo'];
3939
$this->bar = $data['bar'];

src/Symfony/Component/Templating/Helper/HelperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ public function getName();
2727

2828
/**
2929
* Sets the default charset.
30+
*
31+
* @return void
3032
*/
3133
public function setCharset(string $charset);
3234

src/Symfony/Component/Templating/StreamingEngineInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ interface StreamingEngineInterface
2525
*
2626
* @throws \RuntimeException if the template cannot be rendered
2727
* @throws \LogicException if the template cannot be streamed
28+
*
29+
* @return void
2830
*/
2931
public function stream(string|TemplateReferenceInterface $name, array $parameters = []);
3032
}

src/Symfony/Component/Templating/Tests/DelegatingEngineTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,10 @@ public function testStreamDelegatesToSupportedEngine()
5050
$streamingEngine = $this->getStreamingEngineMock('template.php', true);
5151
$streamingEngine->expects($this->once())
5252
->method('stream')
53-
->with('template.php', ['foo' => 'bar'])
54-
->willReturn('<html />');
53+
->with('template.php', ['foo' => 'bar']);
5554

5655
$delegatingEngine = new DelegatingEngine([$streamingEngine]);
57-
$result = $delegatingEngine->stream('template.php', ['foo' => 'bar']);
58-
59-
$this->assertNull($result);
56+
$delegatingEngine->stream('template.php', ['foo' => 'bar']);
6057
}
6158

6259
public function testStreamRequiresStreamingEngine()

src/Symfony/Component/Translation/CatalogueMetadataAwareInterface.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public function getCatalogueMetadata(string $key = '', string $domain = 'message
3131

3232
/**
3333
* Adds catalogue metadata to a message domain.
34+
*
35+
* @return void
3436
*/
3537
public function setCatalogueMetadata(string $key, mixed $value, string $domain = 'messages');
3638

@@ -39,6 +41,8 @@ public function setCatalogueMetadata(string $key, mixed $value, string $domain =
3941
*
4042
* Passing an empty domain will delete all catalogue metadata. Passing an empty key will
4143
* delete all metadata for the given domain.
44+
*
45+
* @return void
4246
*/
4347
public function deleteCatalogueMetadata(string $key = '', string $domain = 'messages');
4448
}

0 commit comments

Comments
 (0)
0