8000 [PHPDoc] Fix some union type cases · symfony/symfony@c76b5ce · GitHub
[go: up one dir, main page]

Skip to content

Commit c76b5ce

Browse files
committed
[PHPDoc] Fix some union type cases
1 parent e357dbb commit c76b5ce

File tree

20 files changed

+29
-39
lines changed

20 files changed

+29
-39
lines changed

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public function getAccessDecisionLog()
389389
/**
390390
* Returns the configuration of the current firewall context.
391391
*
392-
* @return array|Data
392+
* @return array|Data|null
393393
*/
394394
public function getFirewall()
395395
{

src/Symfony/Component/BrowserKit/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function getHeaders()
123123
* @param string $header The header name
124124
* @param bool $first Whether to return the first value or all header values
125125
*
126-
* @return string|array The first header value if $first is true, an array of values otherwise
126+
* @return string|array|null The first header value if $first is true, an array of values otherwise
127127
*/
128128
public function getHeader($header, $first = true)
129129
{

src/Symfony/Component/Console/Descriptor/Descriptor.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,36 +72,26 @@ protected function write($content, $decorated = false)
7272

7373
/**
7474
* Describes an InputArgument instance.
75-
*
76-
* @return string|mixed
7775
*/
7876
abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
7977

8078
/**
8179
* Describes an InputOption instance.
82-
*
83-
* @return string|mixed
8480
*/
8581
abstract protected function describeInputOption(InputOption $option, array $options = []);
8682

8783
/**
8884
* Describes an InputDefinition instance.
89-
*
90-
* @return string|mixed
9185
*/
9286
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
9387

9488
/**
9589
* Describes a Command instance.
96-
*
97-
* @return string|mixed
9890
*/
9991
abstract protected function describeCommand(Command $command, array $options = []);
10092

10193
/**
10294
* Describes an Application instance.
103-
*
104-
* @return string|mixed
10595
*/
10696
abstract protected function describeApplication(Application $application, array $options = []);
10797
}

src/Symfony/Component/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private function formatDefaultValue($default): string
298298
}
299299

300300
/**
301-
* @param (Command|string)[] $commands
301+
* @param array<Command|string> $commands
302302
*/
303303
private function getColumnWidth(array $commands): int
304304
{

src/Symfony/Component/Console/Helper/QuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static function disableStty()
9797
/**
9898
* Asks the question to the user.
9999
*
100-
* @return bool|mixed|string|null
100+
* @return mixed
101101
*
102102
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
103103
*/

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function validate($form, Constraint $formConstraint)
202202
/**
203203
* Returns the validation groups of the given form.
204204
*
205-
* @return string|GroupSequence|(string|GroupSequence)[] The validation groups
205+
* @return string|GroupSequence|array<string|GroupSequence> The validation groups
206206
*/
207207
private function getValidationGroups(FormInterface $form)
208208
{
@@ -241,9 +241,9 @@ private function getValidationGroups(FormInterface $form)
241241
/**
242242
* Post-processes the validation groups option for a given form.
243243
*
244-
* @param string|GroupSequence|(string|GroupSequence)[]|callable $groups The validation groups
244+
* @param string|GroupSequence|array<string|GroupSequence>|callable $groups The validation groups
245245
*
246-
* @return GroupSequence|(string|GroupSequence)[] The validation groups
246+
* @return GroupSequence|array<string|GroupSequence> The validation groups
247247
*/
248248
private static function resolveValidationGroups($groups, FormInterface $form)
249249
{

src/Symfony/Component/HttpFoundation/HeaderBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function hasCacheControlDirective($key)
255255
*
256256
* @param string $key The directive name
257257
*
258-
* @return mixed|null The directive value if defined, null otherwise
258+
* @return mixed The directive value if defined, null otherwise
259259
*/
260260
public function getCacheControlDirective($key)
261261
{

src/Symfony/Component/Mailer/EventListener/EnvelopeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class EnvelopeListener implements EventSubscriberInterface
2828

2929
/**
3030
* @param Address|string $sender
31-
* @param (Address|string)[] $recipients
31+
* @param array<Address|string> $recipients
3232
*/
3333
public function __construct($sender = null, array $recipients = null)
3434
{

src/Symfony/Component/Messenger/Command/AbstractFailedMessagesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function getReceiverName(): string
4545
}
4646

4747
/**
48-
* @return mixed|null
48+
* @return mixed
4949
*/
5050
protected function getMessageId(Envelope $envelope)
5151
{

src/Symfony/Component/Mime/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static function create($address): self
106106
}
107107

108108
/**
109-
* @param (Address|string)[] $addresses
109+
* @param array<Address|string> $addresses
110110
*
111111
* @return Address[]
112112
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getMaxLineLength(): int
5959
}
6060

6161
/**
62-
* @param (Address|string)[] $addresses
62+
* @param array<Address|string> $addresses
6363
*
6464
* @return $this
6565
*/

src/Symfony/Component/Mime/Part/Multipart/FormDataPart.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class FormDataPart extends AbstractMultipartPart
2626
private $fields = [];
2727

2828
/**
29-
* @param (string|array|DataPart)[] $fields
29+
* @param array<string|array|DataPart> $fields
3030
*/
3131
public function __construct(array $fields = [])
3232
{

src/Symfony/Component/Process/Process.php

Lines changed: 2 additions & 2 deletions
< 10000 div data-testid="deletion diffstat" class="DiffSquares-module__diffSquare--h5kjy DiffSquares-module__deletion--hKV3q">
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class Process implements \IteratorAggregate
132132
* @param array $command The command to run and its arguments listed as separate entries
133133
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
134134
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
135-
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
135+
* @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
136136
* @param int|float|null $timeout The timeout in seconds or null to disable
137137
*
138138
* @throws LogicException When proc_open is not installed
@@ -183,7 +183,7 @@ public function __construct($command, string $cwd = null, array $env = null, $in
183183
* @param string $command The command line to pass to the shell of the OS
184184
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
185185
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
186-
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
186+
* @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
187187
* @param int|float|null $timeout The timeout in seconds or null to disable
188188
*
189189
* @return static

src/Symfony/Component/Routing/Loader/XmlFileLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ private function parseDefaultsConfig(\DOMElement $element, string $path)
370370
/**
371371
* Recursively parses the value of a "default" element.
372372
*
373-
* @return array|bool|float|int|string The parsed value
373+
* @return array|bool|float|int|string|null The parsed value
374374
*
375375
* @throws \InvalidArgumentException when the XML is invalid
376376
*/

src/Symfony/Component/Security/Core/User/UserInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface UserInterface
4444
* and populated in any number of different ways when the user object
4545
* is created.
4646
*
47-
* @return (Role|string)[] The user roles
47+
* @return array<Role|string> The user roles
4848
*/
4949
public function getRoles();
5050

src/Symfony/Component/Serializer/Serializer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
6666
private $normalizerCache = [];
6767

6868
/**
69-
* @param (NormalizerInterface|DenormalizerInterface)[] $normalizers
70-
* @param (EncoderInterface|DecoderInterface)[] $encoders
69+
* @param array<NormalizerInterface|DenormalizerInterface> $normalizers
70+
* @param array<EncoderInterface|DecoderInterface> $encoders
7171
*/
7272
public function __construct(array $normalizers = [], array $encoders = [])
7373
{

src/Symfony/Component/Validator/Validator/ContextualValidatorInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function atPath($path);
4242
*
4343
* @param mixed $value The value to validate
4444
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
45-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
45+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
4646
*
4747
* @return $this
4848
*/
@@ -54,7 +54,7 @@ public function validate($value, $constraints = null, $groups = null);
5454
*
5555
* @param object $object The object
5656
* @param string $propertyName The name of the validated property
57-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
57+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
5858
*
5959
* @return $this
6060
*/
@@ -67,7 +67,7 @@ public function validateProperty($object, $propertyName, $groups = null);
6767
* @param object|string $objectOrClass The object or its class name
6868
* @param string $propertyName The name of the property
6969
* @param mixed $value The value to validate against the property's constraints
70-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
70+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
7171
*
7272
* @return $this
7373
*/

src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ public function getViolations()
271271
/**
272272
* Normalizes the given group or list of groups to an array.
273273
*
274-
* @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize
274+
* @param string|GroupSequence|array<string|GroupSequence> $groups The groups to normalize
275275
*
276-
* @return (string|GroupSequence)[] A group array
276+
* @return array<string|GroupSequence> A group array
277277
*/
278278
protected function normalizeGroups($groups)
279279
{

src/Symfony/Component/Validator/Validator/ValidatorInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface ValidatorInterface extends MetadataFactoryInterface
3232
*
3333
* @param mixed $value The value to validate
3434
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
35-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
35+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
3636
*
3737
* @return ConstraintViolationListInterface A list of constraint violations
3838
* If the list is empty, validation
@@ -46,7 +46,7 @@ public function validate($value, $constraints = null, $groups = null);
4646
*
4747
* @param object $object The object
4848
* @param string $propertyName The name of the validated property
49-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
49+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
5050
*
5151
* @return ConstraintViolationListInterface A list of constraint violations
5252
* If the list is empty, validation
@@ -61,7 +61,7 @@ public function validateProperty($object, $propertyName, $groups = null);
6161
* @param object|string $objectOrClass The object or its class name
6262
* @param string $propertyName The name of the property
6363
* @param mixed $value The value to validate against the property's constraints
64-
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
64+
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
6565
*
6666
* @return ConstraintViolationListInterface A list of constraint violations
6767
* If the list is empty, validation

src/Symfony/Contracts/HttpClient/ResponseInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ public function cancel(): void;
9797
* - response_headers (array) - an array modelled after the special $http_response_header variable
9898
* - start_time (float) - the time when the request was sent or 0.0 when it's pending
9999
* - url (string) - the last effective URL of the request
100-
* - user_data (mixed|null) - the value of the "user_data" request option, null if not set
100+
* - user_data (mixed) - the value of the "user_data" request option, null if not set
101101
*
102102
* When the "capture_peer_cert_chain" option is true, the "peer_certificate_chain"
103103
* attribute SHOULD list the peer certificates as an array of OpenSSL X.509 resources.
104104
*
105105
* Other info SHOULD be named after curl_getinfo()'s associative return value.
106106
*
107-
* @return array|mixed|null An array of all available info, or one of them when $type is
107+
* @return array|mixed An array of all available info, or one of them when $type is
108108
* provided, or null when an unsupported type is requested
109109
*/
110110
public function getInfo(string $type = null);

0 commit comments

Comments
 (0)
0