From 0555b7f2ab7f0d297de2ee344dbcb05eb4d487fb Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 12 Apr 2014 19:44:00 +0200 Subject: [PATCH] made types consistent with those defined in Hack --- .../FrameworkBundle/Templating/GlobalVariables.php | 2 +- .../EventListener/WebDebugToolbarListener.php | 4 ++-- src/Symfony/Component/BrowserKit/Client.php | 4 ++-- src/Symfony/Component/BrowserKit/Cookie.php | 6 +++--- .../Component/ClassLoader/ClassCollectionLoader.php | 2 +- src/Symfony/Component/Config/ConfigCache.php | 2 +- .../Component/Config/Definition/ArrayNode.php | 12 ++++++------ src/Symfony/Component/Config/Definition/BaseNode.php | 4 ++-- .../Definition/Builder/ArrayNodeDefinition.php | 2 +- .../Component/Config/Definition/VariableNode.php | 2 +- src/Symfony/Component/Console/Application.php | 4 ++-- .../Component/Console/Formatter/OutputFormatter.php | 4 ++-- src/Symfony/Component/Console/Input/Input.php | 2 +- src/Symfony/Component/Console/Shell.php | 2 +- src/Symfony/Component/DependencyInjection/Alias.php | 2 +- .../Compiler/AnalyzeServiceReferencesPass.php | 2 +- .../Compiler/ResolveDefinitionTemplatesPass.php | 2 +- .../DependencyInjection/ContainerBuilder.php | 2 +- .../Component/DependencyInjection/Definition.php | 10 +++++----- .../DependencyInjection/Extension/Extension.php | 2 +- .../DependencyInjection/Loader/XmlFileLoader.php | 2 +- .../DependencyInjection/Loader/YamlFileLoader.php | 4 ++-- .../ContainerAwareEventDispatcher.php | 2 +- .../Component/EventDispatcher/EventDispatcher.php | 2 +- .../Component/Finder/Adapter/AbstractAdapter.php | 2 +- src/Symfony/Component/Finder/Finder.php | 2 +- .../DataTransformer/DateTimeToArrayTransformer.php | 2 +- src/Symfony/Component/Form/FormConfigBuilder.php | 8 ++++---- .../Form/Tests/Extension/Core/Type/MoneyTypeTest.php | 2 +- src/Symfony/Component/HttpFoundation/Cookie.php | 4 ++-- .../Component/HttpFoundation/File/UploadedFile.php | 2 +- .../HttpKernel/EventListener/ProfilerListener.php | 4 ++-- src/Symfony/Component/HttpKernel/HttpCache/Esi.php | 2 +- src/Symfony/Component/HttpKernel/Kernel.php | 2 +- .../HttpKernel/Profiler/PdoProfilerStorage.php | 2 +- .../HttpKernel/Tests/Fixtures/KernelForTest.php | 2 +- .../Intl/NumberFormatter/NumberFormatter.php | 2 +- src/Symfony/Component/Process/Process.php | 6 +++--- src/Symfony/Component/Process/ProcessPipes.php | 8 ++++---- .../Component/Routing/Generator/UrlGenerator.php | 2 +- .../Component/Security/Acl/Dbal/AclProvider.php | 6 +++--- .../Authentication/AuthenticationProviderManager.php | 2 +- .../Core/Authentication/Token/AbstractToken.php | 4 ++-- .../Core/Authorization/AccessDecisionManager.php | 4 ++-- .../Http/EntryPoint/FormAuthenticationEntryPoint.php | 2 +- src/Symfony/Component/Stopwatch/StopwatchPeriod.php | 4 ++-- .../Component/Translation/Loader/MoFileLoader.php | 2 +- .../Component/Translation/Loader/PoFileLoader.php | 2 +- src/Symfony/Component/Yaml/Inline.php | 2 +- 49 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php index 942ebf8f0a..80ae03fd0c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php @@ -112,6 +112,6 @@ class GlobalVariables */ public function getDebug() { - return (Boolean) $this->container->getParameter('kernel.debug'); + return (bool) $this->container->getParameter('kernel.debug'); } } diff --git a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php index 8835e9d98e..511f4b9796 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php +++ b/src/Symfony/Bundle/WebProfilerBundle/EventListener/WebDebugToolbarListener.php @@ -41,8 +41,8 @@ class WebDebugToolbarListener implements EventSubscriberInterface public function __construct(\Twig_Environment $twig, $interceptRedirects = false, $mode = self::ENABLED, $position = 'bottom') { $this->twig = $twig; - $this->interceptRedirects = (Boolean) $interceptRedirects; - $this->mode = (integer) $mode; + $this->interceptRedirects = (bool) $interceptRedirects; + $this->mode = (int) $mode; $this->position = $position; } diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index 7de075a371..8bf7a8f604 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -76,7 +76,7 @@ abstract class Client */ public function followRedirects($followRedirect = true) { - $this->followRedirects = (Boolean) $followRedirect; + $this->followRedirects = (bool) $followRedirect; } /** @@ -107,7 +107,7 @@ abstract class Client // @codeCoverageIgnoreEnd } - $this->insulated = (Boolean) $insulated; + $this->insulated = (bool) $insulated; } /** diff --git a/src/Symfony/Component/BrowserKit/Cookie.php b/src/Symfony/Component/BrowserKit/Cookie.php index 0b769c520d..15f1bd310a 100644 --- a/src/Symfony/Component/BrowserKit/Cookie.php +++ b/src/Symfony/Component/BrowserKit/Cookie.php @@ -69,11 +69,11 @@ class Cookie $this->rawValue = urlencode($value); } $this->name = $name; - $this->expires = null === $expires ? null : (integer) $expires; + $this->expires = null === $expires ? null : (int) $expires; $this->path = empty($path) ? '/' : $path; $this->domain = $domain; - $this->secure = (Boolean) $secure; - $this->httponly = (Boolean) $httponly; + $this->secure = (bool) $secure; + $this->httponly = (bool) $httponly; } /** diff --git a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php index be1c7e2b55..784b7f5555 100644 --- a/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassCollectionLoader.php @@ -200,7 +200,7 @@ class ClassCollectionLoader */ public static function enableTokenizer($bool) { - self::$useTokenizer = (Boolean) $bool; + self::$useTokenizer = (bool) $bool; } /** diff --git a/src/Symfony/Component/Config/ConfigCache.php b/src/Symfony/Component/Config/ConfigCache.php index 868a0572eb..b7d8347b4f 100644 --- a/src/Symfony/Component/Config/ConfigCache.php +++ b/src/Symfony/Component/Config/ConfigCache.php @@ -37,7 +37,7 @@ class ConfigCache public function __construct($file, $debug) { $this->file = $file; - $this->debug = (Boolean) $debug; + $this->debug = (bool) $debug; } /** diff --git a/src/Symfony/Component/Config/Definition/ArrayNode.php b/src/Symfony/Component/Config/Definition/ArrayNode.php index d906fa3171..5854867213 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -53,7 +53,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface public function setNormalizeKeys($normalizeKeys) { - $this->normalizeKeys = (Boolean) $normalizeKeys; + $this->normalizeKeys = (bool) $normalizeKeys; } /** @@ -113,7 +113,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface */ public function setAddIfNotSet($boolean) { - $this->addIfNotSet = (Boolean) $boolean; + $this->addIfNotSet = (bool) $boolean; } /** @@ -123,7 +123,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface */ public function setAllowFalse($allow) { - $this->allowFalse = (Boolean) $allow; + $this->allowFalse = (bool) $allow; } /** @@ -133,7 +133,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface */ public function setAllowNewKeys($allow) { - $this->allowNewKeys = (Boolean) $allow; + $this->allowNewKeys = (bool) $allow; } /** @@ -143,7 +143,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface */ public function setPerformDeepMerging($boolean) { - $this->performDeepMerging = (Boolean) $boolean; + $this->performDeepMerging = (bool) $boolean; } /** @@ -153,7 +153,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface */ public function setIgnoreExtraKeys($boolean) { - $this->ignoreExtraKeys = (Boolean) $boolean; + $this->ignoreExtraKeys = (bool) $boolean; } /** diff --git a/src/Symfony/Component/Config/Definition/BaseNode.php b/src/Symfony/Component/Config/Definition/BaseNode.php index cbb8df9ca6..10193086fb 100644 --- a/src/Symfony/Component/Config/Definition/BaseNode.php +++ b/src/Symfony/Component/Config/Definition/BaseNode.php @@ -142,7 +142,7 @@ abstract class BaseNode implements NodeInterface */ public function setRequired($boolean) { - $this->required = (Boolean) $boolean; + $this->required = (bool) $boolean; } /** @@ -152,7 +152,7 @@ abstract class BaseNode implements NodeInterface */ public function setAllowOverwrite($allow) { - $this->allowOverwrite = (Boolean) $allow; + $this->allowOverwrite = (bool) $allow; } /** diff --git a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php index 6027fa9caf..b129f66771 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php @@ -309,7 +309,7 @@ class ArrayNodeDefinition extends NodeDefinition implements ParentNodeDefinition */ public function normalizeKeys($bool) { - $this->normalizeKeys = (Boolean) $bool; + $this->normalizeKeys = (bool) $bool; return $this; } diff --git a/src/Symfony/Component/Config/Definition/VariableNode.php b/src/Symfony/Component/Config/Definition/VariableNode.php index 69dfea6d87..883a71420f 100644 --- a/src/Symfony/Component/Config/Definition/VariableNode.php +++ b/src/Symfony/Component/Config/Definition/VariableNode.php @@ -59,7 +59,7 @@ class VariableNode extends BaseNode implements PrototypeNodeInterface */ public function setAllowEmptyValue($boolean) { - $this->allowEmptyValue = (Boolean) $boolean; + $this->allowEmptyValue = (bool) $boolean; } /** diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 20ed3197cd..81b5c2460a 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -276,7 +276,7 @@ class Application */ public function setCatchExceptions($boolean) { - $this->catchExceptions = (Boolean) $boolean; + $this->catchExceptions = (bool) $boolean; } /** @@ -288,7 +288,7 @@ class Application */ public function setAutoExit($boolean) { - $this->autoExit = (Boolean) $boolean; + $this->autoExit = (bool) $boolean; } /** diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatter.php b/src/Symfony/Component/Console/Formatter/OutputFormatter.php index 7b78882e34..2e53d64e08 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatter.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatter.php @@ -46,7 +46,7 @@ class OutputFormatter implements OutputFormatterInterface */ public function __construct($decorated = false, array $styles = array()) { - $this->decorated = (Boolean) $decorated; + $this->decorated = (bool) $decorated; $this->setStyle('error', new OutputFormatterStyle('white', 'red')); $this->setStyle('info', new OutputFormatterStyle('green')); @@ -69,7 +69,7 @@ class OutputFormatter implements OutputFormatterInterface */ public function setDecorated($decorated) { - $this->decorated = (Boolean) $decorated; + $this->decorated = (bool) $decorated; } /** diff --git a/src/Symfony/Component/Console/Input/Input.php b/src/Symfony/Component/Console/Input/Input.php index 275a2cc759..d523a6f83a 100644 --- a/src/Symfony/Component/Console/Input/Input.php +++ b/src/Symfony/Component/Console/Input/Input.php @@ -94,7 +94,7 @@ abstract class Input implements InputInterface */ public function setInteractive($interactive) { - $this->interactive = (Boolean) $interactive; + $this->interactive = (bool) $interactive; } /** diff --git a/src/Symfony/Component/Console/Shell.php b/src/Symfony/Component/Console/Shell.php index 907b63e77c..36dcbbcd8b 100644 --- a/src/Symfony/Component/Console/Shell.php +++ b/src/Symfony/Component/Console/Shell.php @@ -220,7 +220,7 @@ EOF; public function setProcessIsolation($processIsolation) { - $this->processIsolation = (Boolean) $processIsolation; + $this->processIsolation = (bool) $processIsolation; if ($this->processIsolation && !class_exists('Symfony\\Component\\Process\\Process')) { throw new \RuntimeException('Unable to isolate processes as the Symfony Process Component is not installed.'); diff --git a/src/Symfony/Component/DependencyInjection/Alias.php b/src/Symfony/Component/DependencyInjection/Alias.php index fd75578cdb..25f978a104 100644 --- a/src/Symfony/Component/DependencyInjection/Alias.php +++ b/src/Symfony/Component/DependencyInjection/Alias.php @@ -54,7 +54,7 @@ class Alias */ public function setPublic($boolean) { - $this->public = (Boolean) $boolean; + $this->public = (bool) $boolean; } /** diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php index f7aa471dd8..2378fcdd38 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php @@ -40,7 +40,7 @@ class AnalyzeServiceReferencesPass implements RepeatablePassInterface */ public function __construct($onlyConstructorArguments = false) { - $this->onlyConstructorArguments = (Boolean) $onlyConstructorArguments; + $this->onlyConstructorArguments = (bool) $onlyConstructorArguments; } /** diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php index 4699ac3414..4527840e73 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveDefinitionTemplatesPass.php @@ -127,7 +127,7 @@ class ResolveDefinitionTemplatesPass implements CompilerPassInterface throw new RuntimeException(sprintf('Invalid argument key "%s" found.', $k)); } - $index = (integer) substr($k, strlen('index_')); + $index = (int) substr($k, strlen('index_')); $def->replaceArgument($index, $v); } diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index f8101b5963..fb5e4b57a3 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -88,7 +88,7 @@ class ContainerBuilder extends Container implements TaggedContainerInterface */ public function setResourceTracking($track) { - $this->trackResources = (Boolean) $track; + $this->trackResources = (bool) $track; } /** diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php index 1168444389..12874703c1 100644 --- a/src/Symfony/Component/DependencyInjection/Definition.php +++ b/src/Symfony/Component/DependencyInjection/Definition.php @@ -556,7 +556,7 @@ class Definition */ public function setPublic($boolean) { - $this->public = (Boolean) $boolean; + $this->public = (bool) $boolean; return $this; } @@ -584,7 +584,7 @@ class Definition */ public function setSynchronized($boolean) { - $this->synchronized = (Boolean) $boolean; + $this->synchronized = (bool) $boolean; return $this; } @@ -610,7 +610,7 @@ class Definition */ public function setLazy($lazy) { - $this->lazy = (Boolean) $lazy; + $this->lazy = (bool) $lazy; return $this; } @@ -637,7 +637,7 @@ class Definition */ public function setSynthetic($boolean) { - $this->synthetic = (Boolean) $boolean; + $this->synthetic = (bool) $boolean; return $this; } @@ -667,7 +667,7 @@ class Definition */ public function setAbstract($boolean) { - $this->abstract = (Boolean) $boolean; + $this->abstract = (bool) $boolean; return $this; } diff --git a/src/Symfony/Component/DependencyInjection/Extension/Extension.php b/src/Symfony/Component/DependencyInjection/Extension/Extension.php index a39fe37ed4..855da5a38b 100644 --- a/src/Symfony/Component/DependencyInjection/Extension/Extension.php +++ b/src/Symfony/Component/DependencyInjection/Extension/Extension.php @@ -121,6 +121,6 @@ abstract class Extension implements ExtensionInterface, ConfigurationExtensionIn throw new InvalidArgumentException("The config array has no 'enabled' key."); } - return (Boolean) $container->getParameterBag()->resolveValue($config['enabled']); + return (bool) $container->getParameterBag()->resolveValue($config['enabled']); } } diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index b633ea101a..e2097b0e6d 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -102,7 +102,7 @@ class XmlFileLoader extends FileLoader foreach ($imports as $import) { $this->setCurrentDir(dirname($file)); - $this->import((string) $import['resource'], null, (Boolean) $import->getAttributeAsPhp('ignore-errors'), $file); + $this->import((string) $import['resource'], null, (bool) $import->getAttributeAsPhp('ignore-errors'), $file); } } diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 21c706fc59..fe5f00c418 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -94,7 +94,7 @@ class YamlFileLoader extends FileLoader foreach ($content['imports'] as $import) { $this->setCurrentDir(dirname($file)); - $this->import($import['resource'], null, isset($import['ignore_errors']) ? (Boolean) $import['ignore_errors'] : false, $file); + $this->import($import['resource'], null, isset($import['ignore_errors']) ? (bool) $import['ignore_errors'] : false, $file); } } @@ -131,7 +131,7 @@ class YamlFileLoader extends FileLoader return; } elseif (isset($service['alias'])) { - $public = !array_key_exists('public', $service) || (Boolean) $service['public']; + $public = !array_key_exists('public', $service) || (bool) $service['public']; $this->container->setAlias($id, new Alias($service['alias'], $public)); return; diff --git a/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php b/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php index 9448ed43e9..e685b5facd 100644 --- a/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/ContainerAwareEventDispatcher.php @@ -105,7 +105,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher public function hasListeners($eventName = null) { if (null === $eventName) { - return (Boolean) count($this->listenerIds) || (Boolean) count($this->listeners); + return (bool) count($this->listenerIds) || (bool) count($this->listeners); } if (isset($this->listenerIds[$eventName])) { diff --git a/src/Symfony/Component/EventDispatcher/EventDispatcher.php b/src/Symfony/Component/EventDispatcher/EventDispatcher.php index eb1fb5949e..6d2f683a7d 100644 --- a/src/Symfony/Component/EventDispatcher/EventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/EventDispatcher.php @@ -82,7 +82,7 @@ class EventDispatcher implements EventDispatcherInterface */ public function hasListeners($eventName = null) { - return (Boolean) count($this->getListeners($eventName)); + return (bool) count($this->getListeners($eventName)); } /** diff --git a/src/Symfony/Component/Finder/Adapter/AbstractAdapter.php b/src/Symfony/Component/Finder/Adapter/AbstractAdapter.php index 46473b3d5a..fa0a93e1bb 100644 --- a/src/Symfony/Component/Finder/Adapter/AbstractAdapter.php +++ b/src/Symfony/Component/Finder/Adapter/AbstractAdapter.php @@ -216,7 +216,7 @@ abstract class AbstractAdapter implements AdapterInterface */ public function ignoreUnreadableDirs($ignore = true) { - $this->ignoreUnreadableDirs = (Boolean) $ignore; + $this->ignoreUnreadableDirs = (bool) $ignore; return $this; } diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index c075e0ff85..344fbb7304 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -638,7 +638,7 @@ class Finder implements \IteratorAggregate, \Countable */ public function ignoreUnreadableDirs($ignore = true) { - $this->ignoreUnreadableDirs = (Boolean) $ignore; + $this->ignoreUnreadableDirs = (bool) $ignore; return $this; } diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php index e746d00ed5..3b7678ddef 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToArrayTransformer.php @@ -45,7 +45,7 @@ class DateTimeToArrayTransformer extends BaseDateTimeTransformer } $this->fields = $fields; - $this->pad = (Boolean) $pad; + $this->pad = (bool) $pad; } /** diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 1015da4f51..6cc686d53e 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -603,7 +603,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); } - $this->disabled = (Boolean) $disabled; + $this->disabled = (bool) $disabled; return $this; } @@ -631,7 +631,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); } - $this->errorBubbling = null === $errorBubbling ? null : (Boolean) $errorBubbling; + $this->errorBubbling = null === $errorBubbling ? null : (bool) $errorBubbling; return $this; } @@ -645,7 +645,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); } - $this->required = (Boolean) $required; + $this->required = (bool) $required; return $this; } @@ -855,7 +855,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface */ public function setAutoInitialize($initialize) { - $this->autoInitialize = (Boolean) $initialize; + $this->autoInitialize = (bool) $initialize; return $this; } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php index 97fc37fa3d..e42c89c5a8 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/MoneyTypeTest.php @@ -40,7 +40,7 @@ class MoneyTypeTest extends TypeTestCase $form = $this->factory->create('money', null, array('currency' => 'JPY')); $view = $form->createView(); - $this->assertTrue((Boolean) strstr($view->vars['money_pattern'], '¥')); + $this->assertTrue((bool) strstr($view->vars['money_pattern'], '¥')); } // https://github.com/symfony/symfony/issues/5458 diff --git a/src/Symfony/Component/HttpFoundation/Cookie.php b/src/Symfony/Component/HttpFoundation/Cookie.php index 68fe853b2f..c7bceb918c 100644 --- a/src/Symfony/Component/HttpFoundation/Cookie.php +++ b/src/Symfony/Component/HttpFoundation/Cookie.php @@ -70,8 +70,8 @@ class Cookie $this->domain = $domain; $this->expire = $expire; $this->path = empty($path) ? '/' : $path; - $this->secure = (Boolean) $secure; - $this->httpOnly = (Boolean) $httpOnly; + $this->secure = (bool) $secure; + $this->httpOnly = (bool) $httpOnly; } /** diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index 8974337a09..f971ca0aae 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -95,7 +95,7 @@ class UploadedFile extends File $this->mimeType = $mimeType ?: 'application/octet-stream'; $this->size = $size; $this->error = $error ?: UPLOAD_ERR_OK; - $this->test = (Boolean) $test; + $this->test = (bool) $test; parent::__construct($path, UPLOAD_ERR_OK === $this->error); } diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index 30d4011ffe..2295593ab0 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -49,8 +49,8 @@ class ProfilerListener implements EventSubscriberInterface { $this->profiler = $profiler; $this->matcher = $matcher; - $this->onlyException = (Boolean) $onlyException; - $this->onlyMasterRequests = (Boolean) $onlyMasterRequests; + $this->onlyException = (bool) $onlyException; + $this->onlyMasterRequests = (bool) $onlyMasterRequests; $this->children = new \SplObjectStorage(); $this->profiles = array(); } diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php index 455b3dcce9..53acc4d3e5 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -107,7 +107,7 @@ class Esi return false; } - return (Boolean) preg_match('#content="[^"]*ESI/1.0[^"]*"#', $control); + return (bool) preg_match('#content="[^"]*ESI/1.0[^"]*"#', $control); } /** diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 15b5e7b2e8..6ac0e4f370 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -77,7 +77,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface public function __construct($environment, $debug) { $this->environment = $environment; - $this->debug = (Boolean) $debug; + $this->debug = (bool) $debug; $this->booted = false; $this->rootDir = $this->getRootDir(); $this->name = $this->getName(); diff --git a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php index 3f9e03da80..fadd8453f1 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/PdoProfilerStorage.php @@ -59,7 +59,7 @@ abstract class PdoProfilerStorage implements ProfilerStorageInterface $criteria = $criteria ? 'WHERE '.implode(' AND ', $criteria) : ''; $db = $this->initDb(); - $tokens = $this->fetch($db, 'SELECT token, ip, method, url, time, parent FROM sf_profiler_data '.$criteria.' ORDER BY time DESC LIMIT '.((integer) $limit), $args); + $tokens = $this->fetch($db, 'SELECT token, ip, method, url, time, parent FROM sf_profiler_data '.$criteria.' ORDER BY time DESC LIMIT '.((int) $limit), $args); $this->close($db); return $tokens; diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php index e24daef2b3..21583ad40a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForTest.php @@ -49,6 +49,6 @@ class KernelForTest extends Kernel public function setIsBooted($value) { - $this->booted = (Boolean) $value; + $this->booted = (bool) $value; } } diff --git a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php index 8b3388e7ae..b2314ac4f2 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -870,7 +870,7 @@ class NumberFormatter */ private function normalizeGroupingUsedValue($value) { - return (int) (Boolean) (int) $value; + return (int) (bool) (int) $value; } /** diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 3e8ae3cec8..8f78fd5792 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -776,7 +776,7 @@ class Process */ public function setTty($tty) { - $this->tty = (Boolean) $tty; + $this->tty = (bool) $tty; return $this; } @@ -928,7 +928,7 @@ class Process */ public function setEnhanceWindowsCompatibility($enhance) { - $this->enhanceWindowsCompatibility = (Boolean) $enhance; + $this->enhanceWindowsCompatibility = (bool) $enhance; return $this; } @@ -956,7 +956,7 @@ class Process */ public function setEnhanceSigchildCompatibility($enhance) { - $this->enhanceSigchildCompatibility = (Boolean) $enhance; + $this->enhanceSigchildCompatibility = (bool) $enhance; return $this; } diff --git a/src/Symfony/Component/Process/ProcessPipes.php b/src/Symfony/Component/Process/ProcessPipes.php index e6aabc5f99..12cc47a8c8 100644 --- a/src/Symfony/Component/Process/ProcessPipes.php +++ b/src/Symfony/Component/Process/ProcessPipes.php @@ -35,8 +35,8 @@ class ProcessPipes public function __construct($useFiles, $ttyMode) { - $this->useFiles = (Boolean) $useFiles; - $this->ttyMode = (Boolean) $ttyMode; + $this->useFiles = (bool) $useFiles; + $this->ttyMode = (bool) $ttyMode; // Fix for PHP bug #51800: reading from STDOUT pipe hangs forever on Windows if the output is too big. // Workaround for this problem is to use temporary files instead of pipes on Windows platform. @@ -180,10 +180,10 @@ class ProcessPipes public function hasOpenHandles() { if (!$this->useFiles) { - return (Boolean) $this->pipes; + return (bool) $this->pipes; } - return (Boolean) $this->pipes && (Boolean) $this->fileHandles; + return (bool) $this->pipes && (bool) $this->fileHandles; } /** diff --git a/src/Symfony/Component/Routing/Generator/UrlGenerator.php b/src/Symfony/Component/Routing/Generator/UrlGenerator.php index ac64abc6aa..efc04f07b6 100644 --- a/src/Symfony/Component/Routing/Generator/UrlGenerator.php +++ b/src/Symfony/Component/Routing/Generator/UrlGenerator.php @@ -114,7 +114,7 @@ class UrlGenerator implements UrlGeneratorInterface, ConfigurableRequirementsInt */ public function setStrictRequirements($enabled) { - $this->strictRequirements = null === $enabled ? null : (Boolean) $enabled; + $this->strictRequirements = null === $enabled ? null : (bool) $enabled; } /** diff --git a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php index 1d1cb160ed..69d4d955bd 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php @@ -554,7 +554,7 @@ QUERY; $oidCache[$oidLookupKey] = new ObjectIdentity($objectIdentifier, $classType); } - $acl = new Acl((integer) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, !!$entriesInheriting); + $acl = new Acl((int) $aclId, $oidCache[$oidLookupKey], $permissionGrantingStrategy, $emptyArray, !!$entriesInheriting); // keep a local, and global reference to this ACL $loadedAcls[$classType][$objectIdentifier] = $acl; @@ -596,9 +596,9 @@ QUERY; } if (null === $fieldName) { - $loadedAces[$aceId] = new Entry((integer) $aceId, $acl, $sids[$key], $grantingStrategy, (integer) $mask, !!$granting, !!$auditFailure, !!$auditSuccess); + $loadedAces[$aceId] = new Entry((int) $aceId, $acl, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess); } else { - $loadedAces[$aceId] = new FieldEntry((integer) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (integer) $mask, !!$granting, !!$auditFailure, !!$auditSuccess); + $loadedAces[$aceId] = new FieldEntry((int) $aceId, $acl, $fieldName, $sids[$key], $grantingStrategy, (int) $mask, !!$granting, !!$auditFailure, !!$auditSuccess); } } $ace = $loadedAces[$aceId]; diff --git a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php index 8b7474bec4..de1973dc02 100644 --- a/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php +++ b/src/Symfony/Component/Security/Core/Authentication/AuthenticationProviderManager.php @@ -49,7 +49,7 @@ class AuthenticationProviderManager implements AuthenticationManagerInterface } $this->providers = $providers; - $this->eraseCredentials = (Boolean) $eraseCredentials; + $this->eraseCredentials = (bool) $eraseCredentials; } public function setEventDispatcher(EventDispatcherInterface $dispatcher) diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index e4c46d5900..b86e025557 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -131,7 +131,7 @@ abstract class AbstractToken implements TokenInterface */ public function setAuthenticated($authenticated) { - $this->authenticated = (Boolean) $authenticated; + $this->authenticated = (bool) $authenticated; } /** @@ -251,7 +251,7 @@ abstract class AbstractToken implements TokenInterface } if ($this->user instanceof EquatableInterface) { - return ! (Boolean) $this->user->isEqualTo($user); + return ! (bool) $this->user->isEqualTo($user); } if ($this->user->getPassword() !== $user->getPassword()) { diff --git a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php index 6028c42c4b..2b2a1584d0 100644 --- a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php +++ b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php @@ -45,8 +45,8 @@ class AccessDecisionManager implements AccessDecisionManagerInterface $this->voters = $voters; $this->strategy = 'decide'.ucfirst($strategy); - $this->allowIfAllAbstainDecisions = (Boolean) $allowIfAllAbstainDecisions; - $this->allowIfEqualGrantedDeniedDecisions = (Boolean) $allowIfEqualGrantedDeniedDecisions; + $this->allowIfAllAbstainDecisions = (bool) $allowIfAllAbstainDecisions; + $this->allowIfEqualGrantedDeniedDecisions = (bool) $allowIfEqualGrantedDeniedDecisions; } /** diff --git a/src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php b/src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php index b78f0a9a89..06df099a0a 100644 --- a/src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php +++ b/src/Symfony/Component/Security/Http/EntryPoint/FormAuthenticationEntryPoint.php @@ -41,7 +41,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface $this->httpKernel = $kernel; $this->httpUtils = $httpUtils; $this->loginPath = $loginPath; - $this->useForward = (Boolean) $useForward; + $this->useForward = (bool) $useForward; } /** diff --git a/src/Symfony/Component/Stopwatch/StopwatchPeriod.php b/src/Symfony/Component/Stopwatch/StopwatchPeriod.php index 57393f4742..54fd193382 100644 --- a/src/Symfony/Component/Stopwatch/StopwatchPeriod.php +++ b/src/Symfony/Component/Stopwatch/StopwatchPeriod.php @@ -30,8 +30,8 @@ class StopwatchPeriod */ public function __construct($start, $end) { - $this->start = (integer) $start; - $this->end = (integer) $end; + $this->start = (int) $start; + $this->end = (int) $end; $this->memory = memory_get_usage(true); } diff --git a/src/Symfony/Component/Translation/Loader/MoFileLoader.php b/src/Symfony/Component/Translation/Loader/MoFileLoader.php index 88c397cf2f..e3cad7f773 100644 --- a/src/Symfony/Component/Translation/Loader/MoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/MoFileLoader.php @@ -177,6 +177,6 @@ class MoFileLoader extends ArrayLoader implements LoaderInterface $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); $result = current($result); - return (integer) substr($result, -8); + return (int) substr($result, -8); } } diff --git a/src/Symfony/Component/Translation/Loader/PoFileLoader.php b/src/Symfony/Component/Translation/Loader/PoFileLoader.php index 97b1c0c205..73f7f02364 100644 --- a/src/Symfony/Component/Translation/Loader/PoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/PoFileLoader.php @@ -134,7 +134,7 @@ class PoFileLoader extends ArrayLoader implements LoaderInterface $item['ids']['plural'] = substr($line, 14, -1); } elseif (substr($line, 0, 7) === 'msgstr[') { $size = strpos($line, ']'); - $item['translated'][(integer) substr($line, 7, 1)] = substr($line, $size + 3, -1); + $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); } } diff --git a/src/Symfony/Component/Yaml/Inline.php b/src/Symfony/Component/Yaml/Inline.php index 7a2d1486af..88822d4b0b 100644 --- a/src/Symfony/Component/Yaml/Inline.php +++ b/src/Symfony/Component/Yaml/Inline.php @@ -159,7 +159,7 @@ class Inline // array $keys = array_keys($value); if ((1 == count($keys) && '0' == $keys[0]) - || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (integer) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) + || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) ) { $output = array(); foreach ($value as $val) {