minor #40728 [PHPDoc] Fix some union type cases (fancyweb)
This PR was merged into the 4.4 branch.
Discussion
----------
[PHPDoc] Fix some union type cases
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
While working on https://github.com/symfony/symfony/issues/40154, I discovered some PHPDoc issues, I'm going to comment in the review. Upper branches will need some fixes too.
Commits
-------
dd1481642b
[PHPDoc] Fix some union type cases
This commit is contained in:
commit
e2f430dfb4
@ -389,7 +389,7 @@ class SecurityDataCollector extends DataCollector implements LateDataCollectorIn
|
||||
/**
|
||||
* Returns the configuration of the current firewall context.
|
||||
*
|
||||
* @return array|Data
|
||||
* @return array|Data|null
|
||||
*/
|
||||
public function getFirewall()
|
||||
{
|
||||
|
@ -123,7 +123,7 @@ class Response
|
||||
* @param string $header The header name
|
||||
* @param bool $first Whether to return the first value or all header values
|
||||
*
|
||||
* @return string|array The first header value if $first is true, an array of values otherwise
|
||||
* @return string|array|null The first header value if $first is true, an array of values otherwise
|
||||
*/
|
||||
public function getHeader($header, $first = true)
|
||||
{
|
||||
|
@ -72,36 +72,26 @@ abstract class Descriptor implements DescriptorInterface
|
||||
|
||||
/**
|
||||
* Describes an InputArgument instance.
|
||||
*
|
||||
* @return string|mixed
|
||||
*/
|
||||
abstract protected function describeInputArgument(InputArgument $argument, array $options = []);
|
||||
|
||||
/**
|
||||
* Describes an InputOption instance.
|
||||
*
|
||||
* @return string|mixed
|
||||
*/
|
||||
abstract protected function describeInputOption(InputOption $option, array $options = []);
|
||||
|
||||
/**
|
||||
* Describes an InputDefinition instance.
|
||||
*
|
||||
* @return string|mixed
|
||||
*/
|
||||
abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []);
|
||||
|
||||
/**
|
||||
* Describes a Command instance.
|
||||
*
|
||||
* @return string|mixed
|
||||
*/
|
||||
abstract protected function describeCommand(Command $command, array $options = []);
|
||||
|
||||
/**
|
||||
* Describes an Application instance.
|
||||
*
|
||||
* @return string|mixed
|
||||
*/
|
||||
abstract protected function describeApplication(Application $application, array $options = []);
|
||||
}
|
||||
|
@ -298,7 +298,7 @@ class TextDescriptor extends Descriptor
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (Command|string)[] $commands
|
||||
* @param array<Command|string> $commands
|
||||
*/
|
||||
private function getColumnWidth(array $commands): int
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ class QuestionHelper extends Helper
|
||||
/**
|
||||
* Asks the question to the user.
|
||||
*
|
||||
* @return bool|mixed|string|null
|
||||
* @return mixed
|
||||
*
|
||||
* @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden
|
||||
*/
|
||||
|
@ -202,7 +202,7 @@ class FormValidator extends ConstraintValidator
|
||||
/**
|
||||
* Returns the validation groups of the given form.
|
||||
*
|
||||
* @return string|GroupSequence|(string|GroupSequence)[] The validation groups
|
||||
* @return string|GroupSequence|array<string|GroupSequence> The validation groups
|
||||
*/
|
||||
private function getValidationGroups(FormInterface $form)
|
||||
{
|
||||
@ -241,9 +241,9 @@ class FormValidator extends ConstraintValidator
|
||||
/**
|
||||
* Post-processes the validation groups option for a given form.
|
||||
*
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|callable $groups The validation groups
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|callable $groups The validation groups
|
||||
*
|
||||
* @return GroupSequence|(string|GroupSequence)[] The validation groups
|
||||
* @return GroupSequence|array<string|GroupSequence> The validation groups
|
||||
*/
|
||||
private static function resolveValidationGroups($groups, FormInterface $form)
|
||||
{
|
||||
|
@ -255,7 +255,7 @@ class HeaderBag implements \IteratorAggregate, \Countable
|
||||
*
|
||||
* @param string $key The directive name
|
||||
*
|
||||
* @return mixed|null The directive value if defined, null otherwise
|
||||
* @return mixed The directive value if defined, null otherwise
|
||||
*/
|
||||
public function getCacheControlDirective($key)
|
||||
{
|
||||
|
@ -28,7 +28,7 @@ class EnvelopeListener implements EventSubscriberInterface
|
||||
|
||||
/**
|
||||
* @param Address|string $sender
|
||||
* @param (Address|string)[] $recipients
|
||||
* @param array<Address|string> $recipients
|
||||
*/
|
||||
public function __construct($sender = null, array $recipients = null)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ abstract class AbstractFailedMessagesCommand extends Command
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed|null
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getMessageId(Envelope $envelope)
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ final class Address
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (Address|string)[] $addresses
|
||||
* @param array<Address|string> $addresses
|
||||
*
|
||||
* @return Address[]
|
||||
*/
|
||||
|
@ -59,7 +59,7 @@ final class Headers
|
||||
}
|
||||
|
||||
/**
|
||||
* @param (Address|string)[] $addresses
|
||||
* @param array<Address|string> $addresses
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
@ -26,7 +26,7 @@ final class FormDataPart extends AbstractMultipartPart
|
||||
private $fields = [];
|
||||
|
||||
/**
|
||||
* @param (string|array|DataPart)[] $fields
|
||||
* @param array<string|array|DataPart> $fields
|
||||
*/
|
||||
public function __construct(array $fields = [])
|
||||
{
|
||||
|
@ -132,7 +132,7 @@ class Process implements \IteratorAggregate
|
||||
* @param array $command The command to run and its arguments listed as separate entries
|
||||
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
|
||||
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
|
||||
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
|
||||
* @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
|
||||
* @param int|float|null $timeout The timeout in seconds or null to disable
|
||||
*
|
||||
* @throws LogicException When proc_open is not installed
|
||||
@ -183,7 +183,7 @@ class Process implements \IteratorAggregate
|
||||
* @param string $command The command line to pass to the shell of the OS
|
||||
* @param string|null $cwd The working directory or null to use the working dir of the current PHP process
|
||||
* @param array|null $env The environment variables or null to use the same environment as the current PHP process
|
||||
* @param mixed|null $input The input as stream resource, scalar or \Traversable, or null for no input
|
||||
* @param mixed $input The input as stream resource, scalar or \Traversable, or null for no input
|
||||
* @param int|float|null $timeout The timeout in seconds or null to disable
|
||||
*
|
||||
* @return static
|
||||
|
@ -370,7 +370,7 @@ class XmlFileLoader extends FileLoader
|
||||
/**
|
||||
* Recursively parses the value of a "default" element.
|
||||
*
|
||||
* @return array|bool|float|int|string The parsed value
|
||||
* @return array|bool|float|int|string|null The parsed value
|
||||
*
|
||||
* @throws \InvalidArgumentException when the XML is invalid
|
||||
*/
|
||||
|
@ -44,7 +44,7 @@ interface UserInterface
|
||||
* and populated in any number of different ways when the user object
|
||||
* is created.
|
||||
*
|
||||
* @return (Role|string)[] The user roles
|
||||
* @return array<Role|string> The user roles
|
||||
*/
|
||||
public function getRoles();
|
||||
|
||||
|
@ -66,8 +66,8 @@ class Serializer implements SerializerInterface, ContextAwareNormalizerInterface
|
||||
private $normalizerCache = [];
|
||||
|
||||
/**
|
||||
* @param (NormalizerInterface|DenormalizerInterface)[] $normalizers
|
||||
* @param (EncoderInterface|DecoderInterface)[] $encoders
|
||||
* @param array<NormalizerInterface|DenormalizerInterface> $normalizers
|
||||
* @param array<EncoderInterface|DecoderInterface> $encoders
|
||||
*/
|
||||
public function __construct(array $normalizers = [], array $encoders = [])
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ interface ContextualValidatorInterface
|
||||
*
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -54,7 +54,7 @@ interface ContextualValidatorInterface
|
||||
*
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -67,7 +67,7 @@ interface ContextualValidatorInterface
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the property's constraints
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
@ -271,9 +271,9 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
/**
|
||||
* Normalizes the given group or list of groups to an array.
|
||||
*
|
||||
* @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize
|
||||
* @param string|GroupSequence|array<string|GroupSequence> $groups The groups to normalize
|
||||
*
|
||||
* @return (string|GroupSequence)[] A group array
|
||||
* @return array<string|GroupSequence> A group array
|
||||
*/
|
||||
protected function normalizeGroups($groups)
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
*
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
@ -46,7 +46,7 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
*
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
@ -61,7 +61,7 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the property's constraints
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
* @param string|GroupSequence|array<string|GroupSequence>|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
|
@ -97,14 +97,14 @@ interface ResponseInterface
|
||||
* - response_headers (array) - an array modelled after the special $http_response_header variable
|
||||
* - start_time (float) - the time when the request was sent or 0.0 when it's pending
|
||||
* - url (string) - the last effective URL of the request
|
||||
* - user_data (mixed|null) - the value of the "user_data" request option, null if not set
|
||||
* - user_data (mixed) - the value of the "user_data" request option, null if not set
|
||||
*
|
||||
* When the "capture_peer_cert_chain" option is true, the "peer_certificate_chain"
|
||||
* attribute SHOULD list the peer certificates as an array of OpenSSL X.509 resources.
|
||||
*
|
||||
* Other info SHOULD be named after curl_getinfo()'s associative return value.
|
||||
*
|
||||
* @return array|mixed|null An array of all available info, or one of them when $type is
|
||||
* @return array|mixed An array of all available info, or one of them when $type is
|
||||
* provided, or null when an unsupported type is requested
|
||||
*/
|
||||
public function getInfo(string $type = null);
|
||||
|
Reference in New Issue
Block a user