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 331a465b2fdba..95decc6f31a1d 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -291,8 +291,6 @@ protected function detectMetadataDriver($dir, ContainerBuilder $container) 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 b84a60b87fcdf..ccd8a25f165ef 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -88,7 +88,7 @@ public function guessRequired($class, $property) $classMetadatas = $this->getMetadata($class); if (!$classMetadatas) { - return null; + return; } /* @var ClassMetadataInfo $classMetadata */ @@ -116,8 +116,6 @@ public function guessRequired($class, $property) 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 047cf12c5ef69..83ce96f0fa9d8 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -69,8 +69,6 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) 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 56a0c943871c2..47f769057e5b8 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php @@ -66,8 +66,6 @@ public function getColumn($column) 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 592c2506258d4..0ce1f3d92a27b 100644 --- a/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php +++ b/src/Symfony/Bridge/Twig/NodeVisitor/TranslationNodeVisitor.php @@ -111,7 +111,7 @@ private function getReadDomainFromArguments(\Twig_Node $arguments, $index) } elseif ($arguments->hasNode($index)) { $argument = $arguments->getNode($index); } else { - return null; + return; } return $this->getReadDomainFromNode($argument); @@ -125,7 +125,7 @@ private function getReadDomainFromArguments(\Twig_Node $arguments, $index) 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 adc2533dcbf7c..eddaf2a230c84 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php @@ -218,11 +218,11 @@ public function getUser() } 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 8c7746577c2e7..a69e1625c0819 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -441,7 +441,7 @@ protected function filterResponse($response) 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 4e9dda0eb0a6c..a3b0e24b25348 100644 --- a/src/Symfony/Component/BrowserKit/CookieJar.php +++ b/src/Symfony/Component/BrowserKit/CookieJar.php @@ -73,7 +73,7 @@ public function get($name, $path = '/', $domain = null) } } - return null; + return; } // avoid relying on this behavior that is mainly here for BC reasons @@ -82,8 +82,6 @@ public function get($name, $path = '/', $domain = null) 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 71192c8d3a273..71f8bf1558edb 100644 --- a/src/Symfony/Component/Config/Util/XmlUtils.php +++ b/src/Symfony/Component/Config/Util/XmlUtils.php @@ -186,7 +186,7 @@ public static function phpize($value) 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 40f11525c49b1..e522c4bac74a8 100644 --- a/src/Symfony/Component/CssSelector/Parser/TokenStream.php +++ b/src/Symfony/Component/CssSelector/Parser/TokenStream.php @@ -162,7 +162,7 @@ public function getNextIdentifierOrStar() } 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 7d32ec9579812..4a907ece296cf 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -132,7 +132,7 @@ private function getDefinitionId($id) } 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 9351b11b39dcf..aa11d38da175f 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -159,7 +159,7 @@ private function validateScope(Reference $reference, Definition $definition = nu 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 701a3b4b658f0..50c787bea33c2 100644 --- a/src/Symfony/Component/DependencyInjection/Container.php +++ b/src/Symfony/Component/DependencyInjection/Container.php @@ -310,7 +310,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE throw new ServiceNotFoundException($id, null, null, $alternatives); } - return null; + return; } $this->loading[$id] = true; @@ -325,7 +325,7 @@ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE } 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 0d00068e268de..b553298e9e0e3 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -478,7 +478,7 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV $definition = $this->getDefinition($id); } catch (InvalidArgumentException $e) { if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) { - return null; + return; } throw $e; @@ -492,7 +492,7 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV 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 c2ce6c639d5ea..8e01ddb27b2ba 100644 --- a/src/Symfony/Component/DependencyInjection/Extension/Extension.php +++ b/src/Symfony/Component/DependencyInjection/Extension/Extension.php @@ -96,8 +96,6 @@ public function getConfiguration(array $config, ContainerBuilder $container) 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 81ff7aa6feb31..c9f8010268717 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 @@ public function getAlias() 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 b096dcd815464..a96d1db89abaf 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -97,7 +97,7 @@ public function addContent($content, $type = null) // DOM only for HTML/XML content if (!preg_match('/(x|ht)ml/i', $type, $xmlMatches)) { - return null; + return; } $charset = null; @@ -784,8 +784,6 @@ protected function getNode($position) } // @codeCoverageIgnoreStart } - - return null; // @codeCoverageIgnoreEnd } diff --git a/src/Symfony/Component/Form/AbstractExtension.php b/src/Symfony/Component/Form/AbstractExtension.php index 4db77b9bb5e63..dcc41ff484b75 100644 --- a/src/Symfony/Component/Form/AbstractExtension.php +++ b/src/Symfony/Component/Form/AbstractExtension.php @@ -136,7 +136,6 @@ protected function loadTypeExtensions() */ protected function loadTypeGuesser() { - return null; } /** diff --git a/src/Symfony/Component/Form/Button.php b/src/Symfony/Component/Form/Button.php index fe0ab1ad6553d..e39f121a4a240 100644 --- a/src/Symfony/Component/Form/Button.php +++ b/src/Symfony/Component/Form/Button.php @@ -211,7 +211,6 @@ public function setData($modelData) */ public function getData() { - return null; } /** @@ -221,7 +220,6 @@ public function getData() */ public function getNormData() { - return null; } /** @@ -231,7 +229,6 @@ public function getNormData() */ public function getViewData() { - return null; } /** @@ -281,7 +278,6 @@ public function getName() */ public function getPropertyPath() { - return null; } /** diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index b89e01b02f7e5..b4305fb68c771 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -549,7 +549,6 @@ public function getFormConfig() */ public function getEventDispatcher() { - return null; } /** @@ -567,7 +566,6 @@ public function getName() */ public function getPropertyPath() { - return null; } /** @@ -647,7 +645,6 @@ public function getModelTransformers() */ public function getDataMapper() { - return null; } /** @@ -687,7 +684,6 @@ public function getErrorBubbling() */ public function getEmptyData() { - return null; } /** @@ -732,7 +728,6 @@ public function getAttribute($name, $default = null) */ public function getData() { - return null; } /** @@ -742,7 +737,6 @@ public function getData() */ public function getDataClass() { - return null; } /** @@ -762,7 +756,6 @@ public function getDataLocked() */ public function getFormFactory() { - return null; } /** @@ -772,7 +765,6 @@ public function getFormFactory() */ public function getAction() { - return null; } /** @@ -782,7 +774,6 @@ public function getAction() */ public function getMethod() { - return null; } /** @@ -792,7 +783,6 @@ public function getMethod() */ 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 fc080f25c18f1..6cc3a836e5de3 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 @@ public function reverseTransform($array) 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 cf0e9c1102ce8..ad65b01a2cbc2 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 @@ public function __construct($trueValue) 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 1ca1da41c0c5f..a91ed55c3125b 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 @@ public function reverseTransform($values) 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 5a818558d373d..087faf4d3b4eb 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 @@ public function reverseTransform($value) // 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 922d3c5bd84df..ea2ab40e6f0f7 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 @@ public function transform($dateTime) public function reverseTransform($value) { if (null === $value) { - return null; + return; } if (!is_array($value)) { @@ -127,7 +127,7 @@ public function reverseTransform($value) } 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 f04b867599dbd..56a3ca928b0cb 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 @@ public function reverseTransform($value) } 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 6d0b284708f56..e3297ffef325f 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 @@ public function reverseTransform($rfc3339) } 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 32068b06c5a24..6f699040b545a 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 @@ public function transform($value) 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 d2ca6604db8c6..69ca67bbad084 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 @@ public function transform($value) 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 a3f2af42b875b..8b0b241c47d5c 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 @@ public function reverseTransform($value) } 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 2270240d20ca1..f8f78b2e53640 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 @@ public function reverseTransform($value) } 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 ff43697379785..bbf4761fa06f2 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 @@ public function reverseTransform($value) } 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 c34a0139fa743..618fc6b4a4025 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 @@ public function reverseTransform($array) 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 75e95ab41ec4c..c4b97652cdc01 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 83fe717f0da4a..712f5b6de8fe1 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 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) $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 8cbfa6fc9949f..6da2034731fa4 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 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) */ 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 7c5e6784ae7bc..f5bc00daa62ad 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 @@ public function setDefaultOptions(OptionsResolverInterface $resolver) } 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 a20bf5ad649d8..b2a5ec155a0e6 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 @@ public function getPostMaxSize() $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 333fe3cd40284..63d06dca71856 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -159,8 +159,6 @@ public function guessTypeForConstraint(Constraint $constraint) case 'Symfony\Component\Validator\Constraints\False': return new TypeGuess('checkbox', array(), Guess::MEDIUM_CONFIDENCE); } - - return null; } /** @@ -178,8 +176,6 @@ public function guessRequiredForConstraint(Constraint $constraint) case 'Symfony\Component\Validator\Constraints\True': return new ValueGuess(true, Guess::HIGH_CONFIDENCE); } - - return null; } /** @@ -210,8 +206,6 @@ public function guessMaxLengthForConstraint(Constraint $constraint) } break; } - - return null; } /** @@ -250,8 +244,6 @@ public function guessPatternForConstraint(Constraint $constraint) } 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 7b96efb4d6945..9b370f06ba6a9 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 @@ public function match($propertyPath) 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 6ea56eb03b242..1913577695388 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 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $ // 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 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $ 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 12a4241077a97..3941ef842283b 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 @@ public function getLength() 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 990d4cb125087..9be5279411eb6 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -209,7 +209,7 @@ public function getPropertyPath() } if (null === $this->getName() || '' === $this->getName()) { - return null; + return; } $parent = $this->parent; @@ -767,8 +767,6 @@ public function getClickedButton() 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 c79159b3d39f7..c76534473cbb2 100644 --- a/src/Symfony/Component/Form/NativeRequestHandler.php +++ b/src/Symfony/Component/Form/NativeRequestHandler.php @@ -180,7 +180,7 @@ private static function stripEmptyFiles($data) 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 527de1616b12a..e26bf7f1b69dc 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 @@ public function testValidationGroupsCanBeSetToCallback() 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 d26d3f7683e82..626ccf08edcd5 100644 --- a/src/Symfony/Component/Form/Tests/Fixtures/FooType.php +++ b/src/Symfony/Component/Form/Tests/Fixtures/FooType.php @@ -27,6 +27,5 @@ public function getName() 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 f23ddd2f489ea..d87777deddb14 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/FileBinaryMimeTypeGuesser.php @@ -62,7 +62,7 @@ public function guess($path) } if (!self::isSupported()) { - return null; + return; } ob_start(); @@ -72,14 +72,14 @@ public function guess($path) 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 a6950df2cd6ca..697acbcfdd69b 100644 --- a/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php +++ b/src/Symfony/Component/HttpFoundation/File/MimeType/FileinfoMimeTypeGuesser.php @@ -59,11 +59,11 @@ public function guess($path) } 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 0cbd2323e7177..4aec62ca6ff61 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -1264,8 +1264,6 @@ public function getFormat($mimeType) return $format; } } - - return null; } /** diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index d8acef5609dd0..87d071cee1871 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -714,8 +714,6 @@ public function getMaxAge() if (null !== $this->getExpires()) { return $this->getExpires()->format('U') - $this->getDate()->format('U'); } - - return null; } /** @@ -772,8 +770,6 @@ public function getTtl() 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 c5586f05a7ad9..f5fd6e424bd8a 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 @@ private function getMergeSql() 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 6c96c786bed23..51070c59639d3 100644 --- a/src/Symfony/Component/HttpKernel/Bundle/Bundle.php +++ b/src/Symfony/Component/HttpKernel/Bundle/Bundle.php @@ -141,7 +141,6 @@ public function getPath() */ public function getParent() { - return null; } /** diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Store.php b/src/Symfony/Component/HttpKernel/HttpCache/Store.php index d41b9f287ea97..9c75629ca4aca 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Store.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Store.php @@ -121,7 +121,7 @@ public function lookup(Request $request) $key = $this->getCacheKey($request); if (!$entries = $this->getMetadata($key)) { - return null; + return; } // find a cached entry that matches the request. @@ -135,7 +135,7 @@ public function lookup(Request $request) } if (null === $match) { - return null; + return; } list($req, $headers) = $match; @@ -146,7 +146,6 @@ public function lookup(Request $request) // 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 9265fc13f5c58..9d08813f57c1b 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -116,7 +116,7 @@ public function purge() 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 @@ protected function readLineFromFile($file) $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 7f41f0d60eba4..453a9a80c384f 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -77,8 +77,6 @@ public function read($token) 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 42c1c40876da5..f753f9b9d5908 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -273,13 +273,13 @@ public function get($name) 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 9dbb332acb44c..87e877c5cf450 100644 --- a/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php +++ b/src/Symfony/Component/Intl/DateFormatter/IntlDateFormatter.php @@ -379,8 +379,6 @@ public function getTimeZoneId() 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 6b98a29e39741..b09381fa3492a 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php +++ b/src/Symfony/Component/Intl/ResourceBundle/LanguageBundle.php @@ -28,7 +28,7 @@ public function getLanguageName($lang, $region = null, $locale = null) } if (null === ($languages = $this->readEntry($locale, array('Languages'), true))) { - return null; + return; } // Some languages are translated together with their region, @@ -87,7 +87,7 @@ public function getScriptName($script, $lang = null, $locale = null) // "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 e3656fe2ebdf6..4b71c9bcb249b 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Reader/StructuredBundleReader.php @@ -105,7 +105,7 @@ public function readEntry($path, $locale, array $indices, $fallback = true) 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 83cd3252b3353..af4dfea557086 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 @@ private function generateLocaleName($locale, $displayLocale) // 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 @@ private function generateLocaleName($locale, $displayLocale) // 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 @@ private function generateLocaleName($locale, $displayLocale) 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 @@ private function generateLocaleName($locale, $displayLocale) 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 e1feaa2ce0551..5257e9c1ca5c8 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php @@ -20,7 +20,7 @@ public static function get($array, array $indices) { 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 4fadbe82336b5..eb7643dfbdd9d 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 0afb4f2511b06..00eeb2648f51e 100644 --- a/src/Symfony/Component/Intl/Util/Version.php +++ b/src/Symfony/Component/Intl/Util/Version.php @@ -83,7 +83,7 @@ public static function normalize($version, $precision) } 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 109ae204fc732..cfed2396620bd 100644 --- a/src/Symfony/Component/Locale/Locale.php +++ b/src/Symfony/Component/Locale/Locale.php @@ -183,7 +183,7 @@ public static function getIcuDataDirectory() 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 8a1fe5f7da45b..2bb3eb231c570 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -415,8 +415,6 @@ private function findAdderAndRemover(\ReflectionClass $reflClass, array $singula )); } } - - return null; } /** diff --git a/src/Symfony/Component/PropertyAccess/PropertyPath.php b/src/Symfony/Component/PropertyAccess/PropertyPath.php index 840fc71572339..e1b9729e27557 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPath.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPath.php @@ -155,7 +155,7 @@ public function getLength() 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 4c926c2a45215..8475a8a869c74 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -171,7 +171,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa $this->logger->error($message); } - return null; + return; } $url = $token[1].$mergedParams[$token[3]].$url; @@ -224,7 +224,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa $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 b680fb1ea3fcb..9e14af5652c49 100644 --- a/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php +++ b/src/Symfony/Component/Security/Acl/Domain/DoctrineAclCache.php @@ -96,14 +96,14 @@ public function getFromCacheById($aclId) { $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 @@ public function getFromCacheByIdentity(ObjectIdentityInterface $oid) { $key = $this->getDataKeyByIdentity($oid); if (!$this->cache->contains($key)) { - return null; + return; } return $this->unserializeAcl($this->cache->fetch($key)); @@ -154,7 +154,7 @@ private function unserializeAcl($serialized) $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 7dc552c30d4ae..fc66856e3be98 100644 --- a/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php +++ b/src/Symfony/Component/Security/Acl/Domain/ObjectIdentityRetrievalStrategy.php @@ -29,7 +29,7 @@ public function getObjectIdentity($domainObject) 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 30d801f82452f..fa3d54318433b 100644 --- a/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php +++ b/src/Symfony/Component/Security/Acl/Permission/BasicPermissionMap.php @@ -92,7 +92,7 @@ public function __construct() 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 ea91075776767..7fbbf858ace91 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 @@ public function __construct($key) 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 3affd7805a404..21ce8d0ac821f 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 @@ public function __construct(UserProviderInterface $userProvider, UserCheckerInte 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 14fbddab69a84..3728c013d8118 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 @@ public function __construct(UserCheckerInterface $userChecker, $providerKey, $hi 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 b378e1b97ce39..ea2c6a4da633e 100644 --- a/src/Symfony/Component/Security/Core/User/User.php +++ b/src/Symfony/Component/Security/Core/User/User.php @@ -64,7 +64,6 @@ public function getPassword() */ 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 60ab3dfdfb119..c4b0a1eefa2f7 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -171,7 +171,7 @@ private function refreshUser(TokenInterface $token) $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 740d3d658c6e4..9c2456f8d8ac7 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php @@ -142,8 +142,6 @@ final public function autoLogin(Request $request) } $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 f3bf9694d206c..7ec4814d71fc9 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -144,7 +144,7 @@ public function provideCallbacks() 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 8631cf89273b2..99d09529f6521 100644 --- a/src/Symfony/Component/Stopwatch/Stopwatch.php +++ b/src/Symfony/Component/Stopwatch/Stopwatch.php @@ -190,8 +190,6 @@ public function get($id) return $child; } } - - return null; } /** diff --git a/src/Symfony/Component/Translation/MessageCatalogue.php b/src/Symfony/Component/Translation/MessageCatalogue.php index 1d8a08d88578f..aa92a587fbc86 100644 --- a/src/Symfony/Component/Translation/MessageCatalogue.php +++ b/src/Symfony/Component/Translation/MessageCatalogue.php @@ -253,8 +253,6 @@ public function getMetadata($key = '', $domain = 'messages') return $this->metadata[$domain][$key]; } } - - return null; } /** diff --git a/src/Symfony/Component/Validator/Constraint.php b/src/Symfony/Component/Validator/Constraint.php index f2d018e3fbef5..2696dea8bb2a4 100644 --- a/src/Symfony/Component/Validator/Constraint.php +++ b/src/Symfony/Component/Validator/Constraint.php @@ -168,7 +168,6 @@ public function addImplicitGroupName($group) */ public function getDefaultOption() { - return null; } /** diff --git a/src/Symfony/Component/Validator/Constraints/Regex.php b/src/Symfony/Component/Validator/Constraints/Regex.php index 05d441ad9f3f0..d5c3f07743e6e 100644 --- a/src/Symfony/Component/Validator/Constraints/Regex.php +++ b/src/Symfony/Component/Validator/Constraints/Regex.php @@ -78,7 +78,7 @@ private function getNonDelimitedPattern() { // 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 @@ private function getNonDelimitedPattern() return $start.$pattern.$end; } - - return null; } } diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index 31a959187e354..320aa7390a3fe 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -168,8 +168,6 @@ public function getClassName() if ($this->metadata instanceof ClassBasedInterface) { return $this->metadata->getClassName(); } - - return null; } /** @@ -180,8 +178,6 @@ public function getPropertyName() 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 787c78c691485..b3b85c895b016 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/ConstraintAValidator.php @@ -33,7 +33,5 @@ public function validate($value, Constraint $constraint) return; } - - return; } } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php b/src/Symfony/Component/Validator/Tests/Fixtures/FailingConstraintValidator.php index 854e80f35d2c0..a019dd6f836c2 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 ff5bc7cc0c042..b0d6a031f8b83 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -393,7 +393,7 @@ private static function evaluateScalar($scalar) case 'null' === $scalarLower: case '' === $scalar: case '~' === $scalar: - return null; + return; case 'true' === $scalarLower: return true; case 'false' === $scalarLower: @@ -414,7 +414,7 @@ private static function evaluateScalar($scalar) 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); pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy