From 24fb2411c9107fbc59dc0ac5e44d7c747bd8e945 Mon Sep 17 00:00:00 2001 From: Gabriel Caruso Date: Tue, 2 Oct 2018 00:12:00 -0300 Subject: [PATCH] [CS] Enforces null type hint on last position in phpDocs --- Button.php | 2 +- .../Factory/ChoiceListFactoryInterface.php | 16 ++++++++-------- ChoiceList/Factory/PropertyAccessDecorator.php | 16 ++++++++-------- ChoiceList/LazyChoiceList.php | 4 ++-- ChoiceList/Loader/ChoiceLoaderInterface.php | 6 +++--- Extension/Csrf/CsrfExtension.php | 2 +- .../EventListener/CsrfValidationListener.php | 2 +- Extension/Csrf/Type/FormTypeCsrfExtension.php | 2 +- .../Validator/Type/UploadValidatorExtension.php | 2 +- .../Validator/ViolationMapper/MappingRule.php | 2 +- .../ViolationMapper/ViolationMapper.php | 2 +- FormConfigBuilderInterface.php | 2 +- FormConfigInterface.php | 4 ++-- FormTypeInterface.php | 2 +- SubmitButton.php | 2 +- Util/ServerParams.php | 2 +- 16 files changed, 34 insertions(+), 34 deletions(-) diff --git a/Button.php b/Button.php index d783275313..b72e6ae9ee 100644 --- a/Button.php +++ b/Button.php @@ -368,7 +368,7 @@ public function handleRequest($request = null) /** * Submits data to the button. * - * @param null|string $submittedData The data + * @param string|null $submittedData The data * @param bool $clearMissing Not used * * @return $this diff --git a/ChoiceList/Factory/ChoiceListFactoryInterface.php b/ChoiceList/Factory/ChoiceListFactoryInterface.php index c66ce0f028..eae2abf411 100644 --- a/ChoiceList/Factory/ChoiceListFactoryInterface.php +++ b/ChoiceList/Factory/ChoiceListFactoryInterface.php @@ -32,7 +32,7 @@ interface ChoiceListFactoryInterface * argument. * * @param iterable $choices The choices - * @param null|callable $value The callable generating the choice + * @param callable|null $value The callable generating the choice * values * * @return ChoiceListInterface The choice list @@ -51,7 +51,7 @@ public function createListFromChoices($choices, $value = null); * argument. * * @param array|\Traversable $choices The choices - * @param null|callable $value The callable generating the choice + * @param callable|null $value The callable generating the choice * values * * @return ChoiceListInterface The choice list @@ -69,7 +69,7 @@ public function createListFromFlippedChoices($choices, $value = null); * argument. * * @param ChoiceLoaderInterface $loader The choice loader - * @param null|callable $value The callable generating the choice + * @param callable|null $value The callable generating the choice * values * * @return ChoiceListInterface The choice list @@ -103,14 +103,14 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul * attributes that should be added to the respective choice. * * @param ChoiceListInterface $list The choice list - * @param null|array|callable $preferredChoices The preferred choices - * @param null|callable $label The callable generating the + * @param array|callable|null $preferredChoices The preferred choices + * @param callable|null $label The callable generating the * choice labels - * @param null|callable $index The callable generating the + * @param callable|null $index The callable generating the * view indices - * @param null|callable $groupBy The callable generating the + * @param callable|null $groupBy The callable generating the * group names - * @param null|array|callable $attr The callable generating the + * @param array|callable|null $attr The callable generating the * HTML attributes * * @return ChoiceListView The choice list view diff --git a/ChoiceList/Factory/PropertyAccessDecorator.php b/ChoiceList/Factory/PropertyAccessDecorator.php index ee749ca029..01e138411c 100644 --- a/ChoiceList/Factory/PropertyAccessDecorator.php +++ b/ChoiceList/Factory/PropertyAccessDecorator.php @@ -60,7 +60,7 @@ public function getDecoratedFactory() * {@inheritdoc} * * @param iterable $choices The choices - * @param null|callable|string|PropertyPath $value The callable or path for + * @param callable|string|PropertyPath|null $value The callable or path for * generating the choice values * * @return ChoiceListInterface The choice list @@ -91,7 +91,7 @@ public function createListFromChoices($choices, $value = null) * {@inheritdoc} * * @param array|\Traversable $choices The choices - * @param null|callable|string|PropertyPath $value The callable or path for + * @param callable|string|PropertyPath|null $value The callable or path for * generating the choice values * * @return ChoiceListInterface The choice list @@ -110,7 +110,7 @@ public function createListFromFlippedChoices($choices, $value = null, $triggerDe * {@inheritdoc} * * @param ChoiceLoaderInterface $loader The choice loader - * @param null|callable|string|PropertyPath $value The callable or path for + * @param callable|string|PropertyPath|null $value The callable or path for * generating the choice values * * @return ChoiceListInterface The choice list @@ -141,11 +141,11 @@ public function createListFromLoader(ChoiceLoaderInterface $loader, $value = nul * {@inheritdoc} * * @param ChoiceListInterface $list The choice list - * @param null|array|callable|string|PropertyPath $preferredChoices The preferred choices - * @param null|callable|string|PropertyPath $label The callable or path generating the choice labels - * @param null|callable|string|PropertyPath $index The callable or path generating the view indices - * @param null|callable|string|PropertyPath $groupBy The callable or path generating the group names - * @param null|array|callable|string|PropertyPath $attr The callable or path generating the HTML attributes + * @param array|callable|string|PropertyPath|null $preferredChoices The preferred choices + * @param callable|string|PropertyPath|null $label The callable or path generating the choice labels + * @param callable|string|PropertyPath|null $index The callable or path generating the view indices + * @param callable|string|PropertyPath|null $groupBy The callable or path generating the group names + * @param array|callable|string|PropertyPath|null $attr The callable or path generating the HTML attributes * * @return ChoiceListView The choice list view */ diff --git a/ChoiceList/LazyChoiceList.php b/ChoiceList/LazyChoiceList.php index ee00284bc4..406fdd5305 100644 --- a/ChoiceList/LazyChoiceList.php +++ b/ChoiceList/LazyChoiceList.php @@ -34,7 +34,7 @@ class LazyChoiceList implements ChoiceListInterface * * If null, choices are simply cast to strings. * - * @var null|callable + * @var callable|null */ private $value; @@ -51,7 +51,7 @@ class LazyChoiceList implements ChoiceListInterface * argument. * * @param ChoiceLoaderInterface $loader The choice loader - * @param null|callable $value The callable generating the choice values + * @param callable|null $value The callable generating the choice values */ public function __construct(ChoiceLoaderInterface $loader, $value = null) { diff --git a/ChoiceList/Loader/ChoiceLoaderInterface.php b/ChoiceList/Loader/ChoiceLoaderInterface.php index 573cc2d6e3..63e5f65210 100644 --- a/ChoiceList/Loader/ChoiceLoaderInterface.php +++ b/ChoiceList/Loader/ChoiceLoaderInterface.php @@ -31,7 +31,7 @@ interface ChoiceLoaderInterface * The callable receives the choice as first and the array key as the second * argument. * - * @param null|callable $value The callable which generates the values + * @param callable|null $value The callable which generates the values * from choices * * @return ChoiceListInterface The loaded choice list @@ -50,7 +50,7 @@ public function loadChoiceList($value = null); * * @param string[] $values An array of choice values. Non-existing * values in this array are ignored - * @param null|callable $value The callable generating the choice values + * @param callable|null $value The callable generating the choice values * * @return array An array of choices */ @@ -68,7 +68,7 @@ public function loadChoicesForValues(array $values, $value = null); * * @param array $choices An array of choices. Non-existing choices in * this array are ignored - * @param null|callable $value The callable generating the choice values + * @param callable|null $value The callable generating the choice values * * @return string[] An array of choice values */ diff --git a/Extension/Csrf/CsrfExtension.php b/Extension/Csrf/CsrfExtension.php index 99f8d82485..a577608fa7 100644 --- a/Extension/Csrf/CsrfExtension.php +++ b/Extension/Csrf/CsrfExtension.php @@ -32,7 +32,7 @@ class CsrfExtension extends AbstractExtension /** * @param CsrfTokenManagerInterface $tokenManager The CSRF token manager * @param TranslatorInterface $translator The translator for translating error messages - * @param null|string $translationDomain The translation domain for translating + * @param string|null $translationDomain The translation domain for translating */ public function __construct($tokenManager, TranslatorInterface $translator = null, $translationDomain = null) { diff --git a/Extension/Csrf/EventListener/CsrfValidationListener.php b/Extension/Csrf/EventListener/CsrfValidationListener.php index 6dc5599e84..70c4595268 100644 --- a/Extension/Csrf/EventListener/CsrfValidationListener.php +++ b/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -51,7 +51,7 @@ public static function getSubscribedEvents() * same session and with the same tokenId * @param string $errorMessage The message displayed in case of an error * @param TranslatorInterface $translator - * @param null|string $translationDomain + * @param string|null $translationDomain * @param ServerParams $serverParams */ public function __construct($fieldName, $tokenManager, $tokenId, $errorMessage, TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null) diff --git a/Extension/Csrf/Type/FormTypeCsrfExtension.php b/Extension/Csrf/Type/FormTypeCsrfExtension.php index 8ff1a061c9..d27160bb64 100644 --- a/Extension/Csrf/Type/FormTypeCsrfExtension.php +++ b/Extension/Csrf/Type/FormTypeCsrfExtension.php @@ -47,7 +47,7 @@ class FormTypeCsrfExtension extends AbstractTypeExtension * @param bool $defaultEnabled * @param string $defaultFieldName * @param TranslatorInterface $translator - * @param null|string $translationDomain + * @param string|null $translationDomain * @param ServerParams $serverParams */ public function __construct($defaultTokenManager, $defaultEnabled = true, $defaultFieldName = '_token', TranslatorInterface $translator = null, $translationDomain = null, ServerParams $serverParams = null) diff --git a/Extension/Validator/Type/UploadValidatorExtension.php b/Extension/Validator/Type/UploadValidatorExtension.php index 0147afcac2..04e60f6cd3 100644 --- a/Extension/Validator/Type/UploadValidatorExtension.php +++ b/Extension/Validator/Type/UploadValidatorExtension.php @@ -27,7 +27,7 @@ class UploadValidatorExtension extends AbstractTypeExtension /** * @param TranslatorInterface $translator The translator for translating error messages - * @param null|string $translationDomain The translation domain for translating + * @param string|null $translationDomain The translation domain for translating */ public function __construct(TranslatorInterface $translator, $translationDomain = null) { diff --git a/Extension/Validator/ViolationMapper/MappingRule.php b/Extension/Validator/ViolationMapper/MappingRule.php index 98cb0de6a5..590f7df2d8 100644 --- a/Extension/Validator/ViolationMapper/MappingRule.php +++ b/Extension/Validator/ViolationMapper/MappingRule.php @@ -51,7 +51,7 @@ public function getOrigin() * * @param string $propertyPath The property path to match against the rule * - * @return null|FormInterface The mapped form or null + * @return FormInterface|null The mapped form or null */ public function match($propertyPath) { diff --git a/Extension/Validator/ViolationMapper/ViolationMapper.php b/Extension/Validator/ViolationMapper/ViolationMapper.php index b635646f68..9671082a65 100644 --- a/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -144,7 +144,7 @@ public function mapViolation(ConstraintViolation $violation, FormInterface $form * @param FormInterface $form The form to search * @param PropertyPathIteratorInterface $it The iterator at its current position * - * @return null|FormInterface The found match or null + * @return FormInterface|null The found match or null */ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $it) { diff --git a/FormConfigBuilderInterface.php b/FormConfigBuilderInterface.php index 31e5a82210..f422840a82 100644 --- a/FormConfigBuilderInterface.php +++ b/FormConfigBuilderInterface.php @@ -146,7 +146,7 @@ public function setRequired($required); /** * Sets the property path that the form should be mapped to. * - * @param null|string|PropertyPathInterface $propertyPath The property path or null if the path should be set + * @param string|PropertyPathInterface|null $propertyPath The property path or null if the path should be set * automatically based on the form's name * * @return $this The configuration object diff --git a/FormConfigInterface.php b/FormConfigInterface.php index b7083544a4..ce9171f3d4 100644 --- a/FormConfigInterface.php +++ b/FormConfigInterface.php @@ -38,7 +38,7 @@ public function getName(); /** * Returns the property path that the form should be mapped to. * - * @return null|PropertyPathInterface The property path + * @return PropertyPathInterface|null The property path */ public function getPropertyPath(); @@ -167,7 +167,7 @@ public function getData(); /** * Returns the class of the form data or null if the data is scalar or an array. * - * @return null|string The data class or null + * @return string|null The data class or null */ public function getDataClass(); diff --git a/FormTypeInterface.php b/FormTypeInterface.php index 0ad9cae7b7..3c095ab2bb 100644 --- a/FormTypeInterface.php +++ b/FormTypeInterface.php @@ -90,7 +90,7 @@ public function setDefaultOptions(OptionsResolverInterface $resolver); * Symfony 2.8 and will be unsupported as of Symfony 3.0. Return the * fully-qualified class name of the parent type instead. * - * @return string|null|FormTypeInterface The name of the parent type if any, null otherwise + * @return string|FormTypeInterface|null The name of the parent type if any, null otherwise */ public function getParent(); diff --git a/SubmitButton.php b/SubmitButton.php index 2422e11cd8..a838542f97 100644 --- a/SubmitButton.php +++ b/SubmitButton.php @@ -34,7 +34,7 @@ public function isClicked() /** * Submits data to the button. * - * @param null|string $submittedData The data + * @param string|null $submittedData The data * @param bool $clearMissing Not used * * @return $this diff --git a/Util/ServerParams.php b/Util/ServerParams.php index 3d5b76a7c2..57b54a9c6e 100644 --- a/Util/ServerParams.php +++ b/Util/ServerParams.php @@ -41,7 +41,7 @@ public function hasPostMaxSizeBeenExceeded() /** * Returns maximum post size in bytes. * - * @return null|int The maximum post size in bytes + * @return int|null The maximum post size in bytes */ public function getPostMaxSize() {