From d1d569bf7b7495d4305723405efdc8b0ef5a1aec Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 16 Apr 2014 09:15:58 +0200 Subject: [PATCH] unified return null usages --- .../DependencyInjection/AbstractDoctrineExtension.php | 2 -- .../Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php | 4 +--- src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php | 2 -- .../Bridge/Propel1/Tests/Fixtures/ItemQuery.php | 2 -- .../Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php | 4 ++-- .../Bundle/FrameworkBundle/Controller/Controller.php | 4 ++-- src/Symfony/Component/BrowserKit/Client.php | 2 +- src/Symfony/Component/BrowserKit/CookieJar.php | 4 +--- src/Symfony/Component/Config/Util/XmlUtils.php | 2 +- .../Component/CssSelector/Parser/TokenStream.php | 2 +- .../Compiler/AnalyzeServiceReferencesPass.php | 2 +- .../Compiler/CheckReferenceValidityPass.php | 2 +- .../Component/DependencyInjection/Container.php | 4 ++-- .../Component/DependencyInjection/ContainerBuilder.php | 4 ++-- .../DependencyInjection/Extension/Extension.php | 2 -- .../Tests/Fixtures/includes/ProjectExtension.php | 1 - src/Symfony/Component/DomCrawler/Crawler.php | 4 +--- src/Symfony/Component/Form/AbstractExtension.php | 1 - src/Symfony/Component/Form/Button.php | 4 ---- src/Symfony/Component/Form/ButtonBuilder.php | 10 ---------- .../Core/DataTransformer/ArrayToPartsTransformer.php | 2 +- .../DataTransformer/BooleanToStringTransformer.php | 2 +- .../ChoiceToBooleanArrayTransformer.php | 4 +--- .../Core/DataTransformer/ChoiceToValueTransformer.php | 2 +- .../DataTransformer/DateTimeToArrayTransformer.php | 4 ++-- .../DateTimeToLocalizedStringTransformer.php | 2 +- .../DataTransformer/DateTimeToRfc3339Transformer.php | 2 +- .../DataTransformer/DateTimeToStringTransformer.php | 2 +- .../DataTransformer/DateTimeToTimestampTransformer.php | 4 ++-- .../IntegerToLocalizedStringTransformer.php | 2 +- .../NumberToLocalizedStringTransformer.php | 2 +- .../PercentToLocalizedStringTransformer.php | 2 +- .../DataTransformer/ValueToDuplicatesTransformer.php | 2 +- .../Component/Form/Extension/Core/Type/ButtonType.php | 1 - .../Component/Form/Extension/Core/Type/ChoiceType.php | 4 ++-- .../Component/Form/Extension/Core/Type/FormType.php | 1 - .../Validator/Type/BaseValidatorExtension.php | 2 +- .../Form/Extension/Validator/Util/ServerParams.php | 2 +- .../Form/Extension/Validator/ValidatorTypeGuesser.php | 8 -------- .../Validator/ViolationMapper/MappingRule.php | 2 -- .../Validator/ViolationMapper/ViolationMapper.php | 4 +--- .../Validator/ViolationMapper/ViolationPath.php | 2 +- src/Symfony/Component/Form/Form.php | 4 +--- src/Symfony/Component/Form/NativeRequestHandler.php | 2 +- .../Validator/Type/BaseValidatorExtensionTest.php | 2 +- src/Symfony/Component/Form/Tests/Fixtures/FooType.php | 1 - .../File/MimeType/FileBinaryMimeTypeGuesser.php | 6 +++--- .../File/MimeType/FileinfoMimeTypeGuesser.php | 4 ++-- src/Symfony/Component/HttpFoundation/Request.php | 2 -- src/Symfony/Component/HttpFoundation/Response.php | 4 ---- .../Session/Storage/Handler/PdoSessionHandler.php | 2 -- src/Symfony/Component/HttpKernel/Bundle/Bundle.php | 1 - src/Symfony/Component/HttpKernel/HttpCache/Store.php | 5 ++--- .../HttpKernel/Profiler/FileProfilerStorage.php | 4 ++-- .../HttpKernel/Profiler/PdoProfilerStorage.php | 2 -- src/Symfony/Component/HttpKernel/Profiler/Profiler.php | 4 ++-- .../Component/Intl/DateFormatter/IntlDateFormatter.php | 2 -- .../Component/Intl/ResourceBundle/LanguageBundle.php | 4 ++-- .../ResourceBundle/Reader/StructuredBundleReader.php | 2 +- .../Rule/LocaleBundleTransformationRule.php | 8 ++++---- .../Intl/ResourceBundle/Util/RecursiveArrayAccess.php | 2 +- src/Symfony/Component/Intl/Resources/bin/common.php | 2 +- src/Symfony/Component/Intl/Util/Version.php | 2 +- src/Symfony/Component/Locale/Locale.php | 2 +- .../Component/PropertyAccess/PropertyAccessor.php | 2 -- src/Symfony/Component/PropertyAccess/PropertyPath.php | 2 +- .../Component/Routing/Generator/UrlGenerator.php | 4 ++-- .../Component/Security/Acl/Domain/DoctrineAclCache.php | 8 ++++---- .../Acl/Domain/ObjectIdentityRetrievalStrategy.php | 2 +- .../Security/Acl/Permission/BasicPermissionMap.php | 2 +- .../Provider/AnonymousAuthenticationProvider.php | 2 +- .../PreAuthenticatedAuthenticationProvider.php | 2 +- .../Provider/UserAuthenticationProvider.php | 2 +- src/Symfony/Component/Security/Core/User/User.php | 1 - .../Security/Http/Firewall/ContextListener.php | 2 +- .../Http/RememberMe/AbstractRememberMeServices.php | 2 -- .../Tests/Normalizer/GetSetMethodNormalizerTest.php | 2 +- src/Symfony/Component/Stopwatch/Stopwatch.php | 2 -- src/Symfony/Component/Translation/MessageCatalogue.php | 2 -- src/Symfony/Component/Validator/Constraint.php | 1 - src/Symfony/Component/Validator/Constraints/Regex.php | 4 +--- src/Symfony/Component/Validator/ExecutionContext.php | 4 ---- .../Validator/Tests/Fixtures/ConstraintAValidator.php | 2 -- .../Tests/Fixtures/FailingConstraintValidator.php | 2 -- src/Symfony/Component/Yaml/Inline.php | 4 ++-- 85 files changed, 79 insertions(+), 162 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index 331a465b2f..95decc6f31 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -291,8 +291,6 @@ abstract class AbstractDoctrineExtension extends Extension if (is_dir($dir.'/'.$this->getMappingObjectDefaultName())) { return 'annotation'; } - - return null; } /** diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index b84a60b87f..ccd8a25f16 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -88,7 +88,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface $classMetadatas = $this->getMetadata($class); if (!$classMetadatas) { - return null; + return; } /* @var ClassMetadataInfo $classMetadata */ @@ -116,8 +116,6 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface return new ValueGuess(!$mapping['joinColumns'][0]['nullable'], Guess::HIGH_CONFIDENCE); } - - return null; } /** diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 047cf12c5e..83ce96f0fa 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -69,8 +69,6 @@ abstract class DoctrineType extends AbstractType if (null !== $options['query_builder']) { return $type->getLoader($options['em'], $options['query_builder'], $options['class']); } - - return null; }; $choiceList = function (Options $options) use (&$choiceListCache, $propertyAccessor) { diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php index 56a0c94387..47f769057e 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php @@ -66,8 +66,6 @@ class ItemQuery if ($this->hasColumn($column)) { return new Column($column, $this->map[$column]); } - - return null; } /** diff --git a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php index 592c250625..0ce1f3d92a 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php @@ -111,7 +111,7 @@ class TranslationNodeVisitor implements \Twig_NodeVisitorInterface } elseif ($arguments->hasNode($index)) { $argument = $arguments->getNode($index); } else { - return null; + return; } return $this->getReadDomainFromNode($argument); @@ -125,7 +125,7 @@ class TranslationNodeVisitor implements \Twig_NodeVisitorInterface private function getReadDomainFromNode(\Twig_Node $node = null) { if (null === $node) { - return null; + return; } if ($node instanceof \Twig_Node_Expression_Constant) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php index adc2533dcb..eddaf2a230 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -218,11 +218,11 @@ class Controller extends ContainerAware } if (null === $token = $this->container->get('security.context')->getToken()) { - return null; + return; } if (!is_object($user = $token->getUser())) { - return null; + return; } return $user; diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 8c7746577c..a69e1625c0 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -441,7 +441,7 @@ abstract class Client protected function createCrawlerFromContent($uri, $content, $type) { if (!class_exists('Symfony\Component\DomCrawler\Crawler')) { - return null; + return; } $crawler = new Crawler(null, $uri); diff --git a/src/Symfony/Component/BrowserKit/CookieJar.php b/src/Symfony/Component/BrowserKit/CookieJar.php index 4e9dda0eb0..a3b0e24b25 100644 --- a/src/Symfony/Component/BrowserKit/CookieJar.php +++ b/src/Symfony/Component/BrowserKit/CookieJar.php @@ -73,7 +73,7 @@ class CookieJar } } - return null; + return; } // avoid relying on this behavior that is mainly here for BC reasons @@ -82,8 +82,6 @@ class CookieJar return $cookies[$path][$name]; } } - - return null; } /** diff --git a/src/Symfony/Component/Config/Util/XmlUtils.php b/src/Symfony/Component/Config/Util/XmlUtils.php index 71192c8d3a..71f8bf1558 100644 --- a/src/Symfony/Component/Config/Util/XmlUtils.php +++ b/src/Symfony/Component/Config/Util/XmlUtils.php @@ -186,7 +186,7 @@ class XmlUtils switch (true) { case 'null' === $lowercaseValue: - return null; + return; case ctype_digit($value): $raw = $value; $cast = intval($value); diff --git a/src/Symfony/Component/CssSelector/Parser/TokenStream.php b/src/Symfony/Component/CssSelector/Parser/TokenStream.php index 40f11525c4..e522c4bac7 100644 --- a/src/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/src/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -162,7 +162,7 @@ class TokenStream } if ($next->isDelimiter(array('*'))) { - return null; + return; } throw SyntaxErrorException::unexpectedToken('identifier or "*"', $next); diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php index 7d32ec9579..4a907ece29 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -132,7 +132,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface } if (!$this->container->hasDefinition($id)) { - return null; + return; } return $id; diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php index 9351b11b39..aa11d38da1 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -159,7 +159,7 @@ class CheckReferenceValidityPass implements CompilerPassInterface private function getDefinition($id) { if (!$this->container->hasDefinition($id)) { - return null; + return; } return $this->container->getDefinition($id); diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php index 701a3b4b65..50c787bea3 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -310,7 +310,7 @@ class Container implements IntrospectableContainerInterface throw new ServiceNotFoundException($id, null, null, $alternatives); } - return null; + return; } $this->loading[$id] = true; @@ -325,7 +325,7 @@ class Container implements IntrospectableContainerInterface } if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - return null; + return; } throw $e; diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index 0d00068e26..b553298e9e 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -478,7 +478,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface $definition = $this->getDefinition($id); } catch (InvalidArgumentException $e) { if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - return null; + return; } throw $e; @@ -492,7 +492,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface unset($this->loading[$id]); if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - return null; + return; } throw $e; diff --git a/src/Symfony/Component/DependencyInjection/Extension/Extension.php b/src/Symfony/Component/DependencyInjection/Extension/Extension.php index c2ce6c639d..8e01ddb27b 100644 --- a/src/Symfony/Component/DependencyInjection/Extension/Extension.php +++ b/src/Symfony/Component/DependencyInjection/Extension/Extension.php @@ -96,8 +96,6 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn return $configuration; } } - - return null; } final protected function processConfiguration(ConfigurationInterface $configuration, array $configs) diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php index 81ff7aa6fe..c9f8010268 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php @@ -36,6 +36,5 @@ class ProjectExtension implements ExtensionInterface public function getConfiguration(array $config, ContainerBuilder $container) { - return null; } } diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index b096dcd815..a96d1db89a 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -97,7 +97,7 @@ class Crawler extends \SplObjectStorage // DOM only for HTML/XML content if (!preg_match('/(x|ht)ml/i', $type, $xmlMatches)) { - return null; + return; } $charset = null; @@ -784,8 +784,6 @@ class Crawler extends \SplObjectStorage } // @codeCoverageIgnoreStart } - - return null; // @codeCoverageIgnoreEnd } diff --git a/src/Symfony/Component/Form/AbstractExtension.php b/src/Symfony/Component/Form/AbstractExtension.php index 4db77b9bb5..dcc41ff484 100644 --- a/src/Symfony/Component/Form/AbstractExtension.php +++ b/src/Symfony/Component/Form/AbstractExtension.php @@ -136,7 +136,6 @@ abstract class AbstractExtension implements FormExtensionInterface */ protected function loadTypeGuesser() { - return null; } /** diff --git a/src/Symfony/Component/Form/Button.php b/src/Symfony/Component/Form/Button.php index fe0ab1ad65..e39f121a4a 100644 --- a/src/Symfony/Component/Form/Button.php +++ b/src/Symfony/Component/Form/Button.php @@ -211,7 +211,6 @@ class Button implements \IteratorAggregate, FormInterface */ public function getData() { - return null; } /** @@ -221,7 +220,6 @@ class Button implements \IteratorAggregate, FormInterface */ public function getNormData() { - return null; } /** @@ -231,7 +229,6 @@ class Button implements \IteratorAggregate, FormInterface */ public function getViewData() { - return null; } /** @@ -281,7 +278,6 @@ class Button implements \IteratorAggregate, FormInterface */ public function getPropertyPath() { - return null; } /** diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index b89e01b02f..b4305fb68c 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -549,7 +549,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getEventDispatcher() { - return null; } /** @@ -567,7 +566,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getPropertyPath() { - return null; } /** @@ -647,7 +645,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getDataMapper() { - return null; } /** @@ -687,7 +684,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getEmptyData() { - return null; } /** @@ -732,7 +728,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getData() { - return null; } /** @@ -742,7 +737,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getDataClass() { - return null; } /** @@ -762,7 +756,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getFormFactory() { - return null; } /** @@ -772,7 +765,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getAction() { - return null; } /** @@ -782,7 +774,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getMethod() { - return null; } /** @@ -792,7 +783,6 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface */ public function getRequestHandler() { - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php index fc080f25c1..6cc3a836e5 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ArrayToPartsTransformer.php @@ -73,7 +73,7 @@ class ArrayToPartsTransformer implements DataTransformerInterface if (count($emptyKeys) > 0) { if (count($emptyKeys) === count($this->partMapping)) { // All parts empty - return null; + return; } throw new TransformationFailedException( diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php index cf0e9c1102..ad65b01a2c 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php @@ -50,7 +50,7 @@ class BooleanToStringTransformer implements DataTransformerInterface public function transform($value) { if (null === $value) { - return null; + return; } if (!is_bool($value)) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php index 1ca1da41c0..a91ed55c31 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToBooleanArrayTransformer.php @@ -106,13 +106,11 @@ class ChoiceToBooleanArrayTransformer implements DataTransformerInterface if (isset($choices[$i])) { return $choices[$i] === '' ? null : $choices[$i]; } elseif ($this->placeholderPresent && 'placeholder' === $i) { - return null; + return; } else { throw new TransformationFailedException(sprintf('The choice "%s" does not exist', $i)); } } } - - return null; } } diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php index 5a818558d3..087faf4d3b 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ChoiceToValueTransformer.php @@ -46,7 +46,7 @@ class ChoiceToValueTransformer implements DataTransformerInterface // These are now valid ChoiceList values, so we can return null // right away if ('' === $value || null === $value) { - return null; + return; } $choices = $this->choiceList->getChoicesForValues(array($value)); diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php index 922d3c5bd8..ea2ab40e6f 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php @@ -119,7 +119,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer public function reverseTransform($value) { if (null === $value) { - return null; + return; } if (!is_array($value)) { @@ -127,7 +127,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer } if ('' === implode('', $value)) { - return null; + return; } $emptyFields = array(); diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php index f04b867599..56a3ca928b 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToLocalizedStringTransformer.php @@ -121,7 +121,7 @@ class DateTimeToLocalizedStringTransformer extends BaseDateTimeTransformer } if ('' === $value) { - return null; + return; } $timestamp = $this->getIntlDateFormatter()->parse($value); diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php index 6d0b284708..e3297ffef3 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToRfc3339Transformer.php @@ -49,7 +49,7 @@ class DateTimeToRfc3339Transformer extends BaseDateTimeTransformer } if ('' === $rfc3339) { - return null; + return; } try { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php index 32068b06c5..6f699040b5 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php @@ -131,7 +131,7 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer public function reverseTransform($value) { if (empty($value)) { - return null; + return; } if (!is_string($value)) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php index d2ca6604db..69ca67bbad 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToTimestampTransformer.php @@ -35,7 +35,7 @@ class DateTimeToTimestampTransformer extends BaseDateTimeTransformer public function transform($value) { if (null === $value) { - return null; + return; } if (!$value instanceof \DateTime) { @@ -65,7 +65,7 @@ class DateTimeToTimestampTransformer extends BaseDateTimeTransformer public function reverseTransform($value) { if (null === $value) { - return null; + return; } if (!is_numeric($value)) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php index a3f2af42b8..8b0b241c47 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php @@ -31,7 +31,7 @@ class IntegerToLocalizedStringTransformer extends NumberToLocalizedStringTransfo } if ('' === $value) { - return null; + return; } if ('NaN' === $value) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php index 2270240d20..f8f78b2e53 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php @@ -102,7 +102,7 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface } if ('' === $value) { - return null; + return; } if ('NaN' === $value) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php index ff43697379..bbf4761fa0 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/PercentToLocalizedStringTransformer.php @@ -115,7 +115,7 @@ class PercentToLocalizedStringTransformer implements DataTransformerInterface } if ('' === $value) { - return null; + return; } $formatter = $this->getNumberFormatter(); diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php index c34a0139fa..618fc6b4a4 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToDuplicatesTransformer.php @@ -78,7 +78,7 @@ class ValueToDuplicatesTransformer implements DataTransformerInterface if (count($emptyKeys) > 0) { if (count($emptyKeys) == count($this->keys)) { // All keys empty - return null; + return; } throw new TransformationFailedException( diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ButtonType.php b/src/Symfony/Component/Form/Extension/Core/Type/ButtonType.php index 75e95ab41e..c4b97652cd 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ButtonType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ButtonType.php @@ -26,7 +26,6 @@ class ButtonType extends BaseType implements ButtonTypeInterface */ public function getParent() { - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 83fe717f0d..712f5b6de8 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -190,10 +190,10 @@ class ChoiceType extends AbstractType $emptyValueNormalizer = function (Options $options, $emptyValue) { if ($options['multiple']) { // never use an empty value for this case - return null; + return; } elseif (false === $emptyValue) { // an empty value should be added but the user decided otherwise - return null; + return; } elseif ($options['expanded'] && '' === $emptyValue) { // never use an empty label for radio buttons return 'None'; diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php index 8cbfa6fc99..6da2034731 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -201,7 +201,6 @@ class FormType extends BaseType */ public function getParent() { - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php b/src/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php index 7c5e6784ae..f5bc00daa6 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/Type/BaseValidatorExtension.php @@ -35,7 +35,7 @@ abstract class BaseValidatorExtension extends AbstractTypeExtension } if (empty($groups)) { - return null; + return; } if (is_callable($groups)) { diff --git a/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php b/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php index a20bf5ad64..b2a5ec155a 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php +++ b/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php @@ -26,7 +26,7 @@ class ServerParams $iniMax = strtolower($this->getNormalizedIniPostMaxSize()); if ('' === $iniMax) { - return null; + return; } $max = ltrim($iniMax, '+'); diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index 333fe3cd40..63d06dca71 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -159,8 +159,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface case 'Symfony\Component\Validator\Constraints\False': return new TypeGuess('checkbox', array(), Guess::MEDIUM_CONFIDENCE); } - - return null; } /** @@ -178,8 +176,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface case 'Symfony\Component\Validator\Constraints\True': return new ValueGuess(true, Guess::HIGH_CONFIDENCE); } - - return null; } /** @@ -210,8 +206,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface } break; } - - return null; } /** @@ -250,8 +244,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface } break; } - - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php index 7b96efb4d6..9b370f06ba 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/MappingRule.php @@ -64,8 +64,6 @@ class MappingRule if ($propertyPath === (string) $this->propertyPath) { return $this->getTarget(); } - - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php index 6ea56eb03b..1913577695 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php @@ -172,7 +172,7 @@ class ViolationMapper implements ViolationMapperInterface // Make the path longer until we find a matching child while (true) { if (!$it->valid()) { - return null; + return; } if ($it->isIndex()) { @@ -223,8 +223,6 @@ class ViolationMapper implements ViolationMapperInterface return $foundChild; } } - - return null; } /** diff --git a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php index 12a4241077..3941ef8422 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php +++ b/src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationPath.php @@ -127,7 +127,7 @@ class ViolationPath implements \IteratorAggregate, PropertyPathInterface public function getParent() { if ($this->length <= 1) { - return null; + return; } $parent = clone $this; diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 990d4cb125..9be5279411 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -209,7 +209,7 @@ class Form implements \IteratorAggregate, FormInterface } if (null === $this->getName() || '' === $this->getName()) { - return null; + return; } $parent = $this->parent; @@ -767,8 +767,6 @@ class Form implements \IteratorAggregate, FormInterface if ($this->parent && method_exists($this->parent, 'getClickedButton')) { return $this->parent->getClickedButton(); } - - return null; } /** diff --git a/src/Symfony/Component/Form/NativeRequestHandler.php b/src/Symfony/Component/Form/NativeRequestHandler.php index c79159b3d3..c76534473c 100644 --- a/src/Symfony/Component/Form/NativeRequestHandler.php +++ b/src/Symfony/Component/Form/NativeRequestHandler.php @@ -180,7 +180,7 @@ class NativeRequestHandler implements RequestHandlerInterface if (self::$fileKeys === $keys) { if (UPLOAD_ERR_NO_FILE === $data['error']) { - return null; + return; } return $data; diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php index 527de1616b..e26bf7f1b6 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php @@ -64,7 +64,7 @@ abstract class BaseValidatorExtensionTest extends TypeTestCase public function testValidationGroupsCanBeSetToClosure() { $form = $this->createForm(array( - 'validation_groups' => function (FormInterface $form) { return null; }, + 'validation_groups' => function (FormInterface $form) { return; }, )); $this->assertTrue(is_callable($form->getConfig()->getOption('validation_groups'))); diff --git a/src/Symfony/Component/Form/Tests/Fixtures/FooType.php b/src/Symfony/Component/Form/Tests/Fixtures/FooType.php index d26d3f7683..626ccf08ed 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/FooType.php +++ b/src/Symfony/Component/Form/Tests/Fixtures/FooType.php @@ -27,6 +27,5 @@ class FooType extends AbstractType public function getParent() { - return null; } } diff --git a/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php b/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php index f23ddd2f48..d87777dedd 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php @@ -62,7 +62,7 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface } if (!self::isSupported()) { - return null; + return; } ob_start(); @@ -72,14 +72,14 @@ class FileBinaryMimeTypeGuesser implements MimeTypeGuesserInterface if ($return > 0) { ob_end_clean(); - return null; + return; } $type = trim(ob_get_clean()); if (!preg_match('#^([a-z0-9\-]+/[a-z0-9\-\.]+)#i', $type, $match)) { // it's not a type, but an error message - return null; + return; } return $match[1]; diff --git a/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php b/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php index a6950df2cd..697acbcfdd 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php @@ -59,11 +59,11 @@ class FileinfoMimeTypeGuesser implements MimeTypeGuesserInterface } if (!self::isSupported()) { - return null; + return; } if (!$finfo = new \finfo(FILEINFO_MIME_TYPE, $this->magicFile)) { - return null; + return; } return $finfo->file($path); diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index 0cbd2323e7..4aec62ca6f 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1264,8 +1264,6 @@ class Request return $format; } } - - return null; } /** diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index d8acef5609..87d071cee1 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -714,8 +714,6 @@ class Response if (null !== $this->getExpires()) { return $this->getExpires()->format('U') - $this->getDate()->format('U'); } - - return null; } /** @@ -772,8 +770,6 @@ class Response if (null !== $maxAge = $this->getMaxAge()) { return $maxAge - $this->getAge(); } - - return null; } /** diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php index c5586f05a7..f5fd6e424b 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -239,7 +239,5 @@ class PdoSessionHandler implements \SessionHandlerInterface case 'sqlite': return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)"; } - - return null; } } diff --git a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php index 6c96c786be..51070c5963 100644 --- a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php +++ b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php @@ -141,7 +141,6 @@ abstract class Bundle extends ContainerAware implements BundleInterface */ public function getParent() { - return null; } /** diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Store.php b/src/Symfony/Component/HttpKernel/HttpCache/Store.php index d41b9f287e..9c75629ca4 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -121,7 +121,7 @@ class Store implements StoreInterface $key = $this->getCacheKey($request); if (!$entries = $this->getMetadata($key)) { - return null; + return; } // find a cached entry that matches the request. @@ -135,7 +135,7 @@ class Store implements StoreInterface } if (null === $match) { - return null; + return; } list($req, $headers) = $match; @@ -146,7 +146,6 @@ class Store implements StoreInterface // TODO the metaStore referenced an entity that doesn't exist in // the entityStore. We definitely want to return nil but we should // also purge the entry from the meta-store when this is detected. - return null; } /** diff --git a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php index 9265fc13f5..9d08813f57 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -116,7 +116,7 @@ class FileProfilerStorage implements ProfilerStorageInterface public function read($token) { if (!$token || !file_exists($file = $this->getFilename($token))) { - return null; + return; } return $this->createProfileFromData($token, unserialize(file_get_contents($file))); @@ -215,7 +215,7 @@ class FileProfilerStorage implements ProfilerStorageInterface $position = ftell($file); if (0 === $position) { - return null; + return; } while (true) { diff --git a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php index 7f41f0d60e..453a9a80c3 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -77,8 +77,6 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface if (isset($data[0]['data'])) { return $this->createProfileFromData($token, $data[0]); } - - return null; } /** diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php index 42c1c40876..f753f9b9d5 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -273,13 +273,13 @@ class Profiler private function getTimestamp($value) { if (null === $value || '' == $value) { - return null; + return; } try { $value = new \DateTime(is_numeric($value) ? '@'.$value : $value); } catch (\Exception $e) { - return null; + return; } return $value->getTimestamp(); diff --git a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php index 9dbb332acb..87e877c5cf 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -379,8 +379,6 @@ class IntlDateFormatter if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { return date_default_timezone_get(); } - - return null; } /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php index 6b98a29e39..b09381fa34 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php @@ -28,7 +28,7 @@ class LanguageBundle extends AbstractBundle implements LanguageBundleInterface } if (null === ($languages = $this->readEntry($locale, array('Languages'), true))) { - return null; + return; } // Some languages are translated together with their region, @@ -87,7 +87,7 @@ class LanguageBundle extends AbstractBundle implements LanguageBundleInterface // "af" (Afrikaans) has no "Scripts" block if (!isset($data['Scripts'][$script])) { - return null; + return; } return $data['Scripts'][$script]; diff --git a/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php b/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php index e3656fe2eb..4b71c9bcb2 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php @@ -105,7 +105,7 @@ class StructuredBundleReader implements StructuredBundleReaderInterface private function getFallbackLocale($locale) { if (false === $pos = strrpos($locale, '_')) { - return null; + return; } return substr($locale, 0, $pos); diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php index 83cd3252b3..af4dfea557 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php @@ -195,7 +195,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface // Currently the only available variant is POSIX, which we don't want // to include in the list if (count($variants) > 0) { - return null; + return; } // Some languages are translated together with their region, @@ -207,7 +207,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface // Some languages are simply not translated // Example: "az" (Azerbaijani) has no translation in "af" (Afrikaans) if (null === ($name = $this->languageBundle->getLanguageName($lang, null, $displayLocale))) { - return null; + return; } // "as" (Assamese) has no "Variants" block @@ -222,7 +222,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface if ($script) { // Some scripts are not translated into every language if (null === ($scriptName = $this->languageBundle->getScriptName($script, $lang, $displayLocale))) { - return null; + return; } $extras[] = $scriptName; @@ -233,7 +233,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface if ($region) { // Some regions are not translated into every language if (null === ($regionName = $this->regionBundle->getCountryName($region, $displayLocale))) { - return null; + return; } $extras[] = $regionName; diff --git a/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php b/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php index e1feaa2ce0..5257e9c1ca 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php @@ -20,7 +20,7 @@ class RecursiveArrayAccess { foreach ($indices as $index) { if (!$array instanceof \ArrayAccess && !is_array($array)) { - return null; + return; } $array = $array[$index]; diff --git a/src/Symfony/Component/Intl/Resources/bin/common.php b/src/Symfony/Component/Intl/Resources/bin/common.php index 4fadbe8233..eb7643dfbd 100644 --- a/src/Symfony/Component/Intl/Resources/bin/common.php +++ b/src/Symfony/Component/Intl/Resources/bin/common.php @@ -62,7 +62,7 @@ function get_icu_version_from_genrb($genrb) } if (!preg_match('/ICU version ([\d\.]+)/', implode('', $output), $matches)) { - return null; + return; } return $matches[1]; diff --git a/src/Symfony/Component/Intl/Util/Version.php b/src/Symfony/Component/Intl/Util/Version.php index 0afb4f2511..00eeb2648f 100644 --- a/src/Symfony/Component/Intl/Util/Version.php +++ b/src/Symfony/Component/Intl/Util/Version.php @@ -83,7 +83,7 @@ class Version } if (!preg_match('/^' . $pattern . '/', $version, $matches)) { - return null; + return; } return $matches[0]; diff --git a/src/Symfony/Component/Locale/Locale.php b/src/Symfony/Component/Locale/Locale.php index 109ae204fc..cfed239662 100644 --- a/src/Symfony/Component/Locale/Locale.php +++ b/src/Symfony/Component/Locale/Locale.php @@ -183,7 +183,7 @@ class Locale extends \Locale protected static function getFallbackLocale($locale) { if (false === $pos = strrpos($locale, '_')) { - return null; + return; } return substr($locale, 0, $pos); diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index 8a1fe5f7da..2bb3eb231c 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -415,8 +415,6 @@ class PropertyAccessor implements PropertyAccessorInterface )); } } - - return null; } /** diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index 840fc71572..e1b9729e27 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -155,7 +155,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface public function getParent() { if ($this->length <= 1) { - return null; + return; } $parent = clone $this; diff --git a/src/Symfony/Component/Routing/Generator/UrlGenerator.php b/src/Symfony/Component/Routing/Generator/UrlGenerator.php index 4c926c2a45..8475a8a869 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -171,7 +171,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt $this->logger->error($message); } - return null; + return; } $url = $token[1].$mergedParams[$token[3]].$url; @@ -224,7 +224,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt $this->logger->error($message); } - return null; + return; } $routeHost = $token[1].$mergedParams[$token[3]].$routeHost; diff --git a/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php b/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php index b680fb1ea3..9e14af5652 100644 --- a/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php +++ b/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php @@ -96,14 +96,14 @@ class DoctrineAclCache implements AclCacheInterface { $lookupKey = $this->getAliasKeyForIdentity($aclId); if (!$this->cache->contains($lookupKey)) { - return null; + return; } $key = $this->cache->fetch($lookupKey); if (!$this->cache->contains($key)) { $this->cache->delete($lookupKey); - return null; + return; } return $this->unserializeAcl($this->cache->fetch($key)); @@ -116,7 +116,7 @@ class DoctrineAclCache implements AclCacheInterface { $key = $this->getDataKeyByIdentity($oid); if (!$this->cache->contains($key)) { - return null; + return; } return $this->unserializeAcl($this->cache->fetch($key)); @@ -154,7 +154,7 @@ class DoctrineAclCache implements AclCacheInterface $parentAcl = $this->getFromCacheById($parentId); if (null === $parentAcl) { - return null; + return; } $acl->setParentAcl($parentAcl); diff --git a/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php b/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php index 7dc552c30d..fc66856e3b 100644 --- a/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php +++ b/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php @@ -29,7 +29,7 @@ class ObjectIdentityRetrievalStrategy implements ObjectIdentityRetrievalStrategy try { return ObjectIdentity::fromDomainObject($domainObject); } catch (InvalidDomainObjectException $failed) { - return null; + return; } } } diff --git a/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php b/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php index 30d801f824..fa3d543184 100644 --- a/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php +++ b/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php @@ -92,7 +92,7 @@ class BasicPermissionMap implements PermissionMapInterface public function getMasks($permission, $object) { if (!isset($this->map[$permission])) { - return null; + return; } return $this->map[$permission]; diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php index ea91075776..7fbbf858ac 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/AnonymousAuthenticationProvider.php @@ -40,7 +40,7 @@ class AnonymousAuthenticationProvider implements AuthenticationProviderInterface public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } if ($this->key !== $token->getKey()) { diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index 3affd7805a..21ce8d0ac8 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -53,7 +53,7 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } if (!$user = $token->getUser()) { diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php index 14fbddab69..3728c013d8 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/UserAuthenticationProvider.php @@ -58,7 +58,7 @@ abstract class UserAuthenticationProvider implements AuthenticationProviderInter public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { - return null; + return; } $username = $token->getUsername(); diff --git a/src/Symfony/Component/Security/Core/User/User.php b/src/Symfony/Component/Security/Core/User/User.php index b378e1b97c..ea2c6a4da6 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -64,7 +64,6 @@ final class User implements AdvancedUserInterface */ public function getSalt() { - return null; } /** diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 60ab3dfdfb..c4b0a1eefa 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -171,7 +171,7 @@ class ContextListener implements ListenerInterface $this->logger->warning(sprintf('Username "%s" could not be found.', $notFound->getUsername())); } - return null; + return; } } diff --git a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php index 740d3d658c..9c2456f8d8 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php @@ -142,8 +142,6 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface } $this->cancelCookie($request); - - return null; } /** diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index f3bf9694d2..7ec4814d71 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -144,7 +144,7 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bar) { - return null; + return; }, ), 'baz', diff --git a/src/Symfony/Component/Stopwatch/Stopwatch.php b/src/Symfony/Component/Stopwatch/Stopwatch.php index 8631cf8927..99d09529f6 100644 --- a/src/Symfony/Component/Stopwatch/Stopwatch.php +++ b/src/Symfony/Component/Stopwatch/Stopwatch.php @@ -190,8 +190,6 @@ class Section return $child; } } - - return null; } /** diff --git a/src/Symfony/Component/Translation/MessageCatalogue.php b/src/Symfony/Component/Translation/MessageCatalogue.php index 1d8a08d885..aa92a587fb 100644 --- a/src/Symfony/Component/Translation/MessageCatalogue.php +++ b/src/Symfony/Component/Translation/MessageCatalogue.php @@ -253,8 +253,6 @@ class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterf return $this->metadata[$domain][$key]; } } - - return null; } /** diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php index f2d018e3fb..2696dea8bb 100644 --- a/src/Symfony/Component/Validator/Constraint.php +++ b/src/Symfony/Component/Validator/Constraint.php @@ -168,7 +168,6 @@ abstract class Constraint */ public function getDefaultOption() { - return null; } /** diff --git a/src/Symfony/Component/Validator/Constraints/Regex.php b/src/Symfony/Component/Validator/Constraints/Regex.php index 05d441ad9f..d5c3f07743 100644 --- a/src/Symfony/Component/Validator/Constraints/Regex.php +++ b/src/Symfony/Component/Validator/Constraints/Regex.php @@ -78,7 +78,7 @@ class Regex extends Constraint { // If match = false, pattern should not be added to HTML5 validation if (!$this->match) { - return null; + return; } if (preg_match('/^(.)(\^?)(.*?)(\$?)\1$/', $this->pattern, $matches)) { @@ -92,7 +92,5 @@ class Regex extends Constraint return $start.$pattern.$end; } - - return null; } } diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index 31a959187e..320aa7390a 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -168,8 +168,6 @@ class ExecutionContext implements ExecutionContextInterface if ($this->metadata instanceof ClassBasedInterface) { return $this->metadata->getClassName(); } - - return null; } /** @@ -180,8 +178,6 @@ class ExecutionContext implements ExecutionContextInterface if ($this->metadata instanceof PropertyMetadataInterface) { return $this->metadata->getPropertyName(); } - - return null; } /** diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php index 787c78c691..b3b85c895b 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php @@ -33,7 +33,5 @@ class ConstraintAValidator extends ConstraintValidator return; } - - return; } } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php b/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php index 854e80f35d..a019dd6f83 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php @@ -19,7 +19,5 @@ class FailingConstraintValidator extends ConstraintValidator public function validate($value, Constraint $constraint) { $this->context->addViolation($constraint->message, array()); - - return; } } diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index ff5bc7cc0c..b0d6a031f8 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -393,7 +393,7 @@ class Inline case 'null' === $scalarLower: case '' === $scalar: case '~' === $scalar: - return null; + return; case 'true' === $scalarLower: return true; case 'false' === $scalarLower: @@ -414,7 +414,7 @@ class Inline throw new ParseException('Object support when parsing a YAML file has been disabled.'); } - return null; + return; case ctype_digit($scalar): $raw = $scalar; $cast = intval($scalar);