From 92bfbf575c48561d0110ad8194b3e97cf1795c2a Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Sun, 27 Feb 2011 20:56:29 +0100 Subject: [PATCH] Fixed CS --- .../CacheWarmer/ProxyCacheWarmer.php | 2 +- .../Command/DoctrineCommand.php | 2 +- .../Command/InfoDoctrineCommand.php | 6 +- .../DoctrineBundle/ConnectionFactory.php | 2 +- .../CacheWarmer/ProxyCacheWarmerTest.php | 6 +- .../AbstractDoctrineExtensionTest.php | 2 +- .../DependencyInjection/XMLSchemaTest.php | 2 +- .../CacheWarmer/HydratorCacheWarmer.php | 2 +- .../CacheWarmer/ProxyCacheWarmer.php | 2 +- .../Command/DoctrineODMCommand.php | 2 +- .../DoctrineMongoDBExtension.php | 2 +- .../CacheWarmer/HydratorCacheWarmerTest.php | 6 +- .../CacheWarmer/ProxyCacheWarmerTest.php | 6 +- .../Controller/InternalController.php | 3 +- .../Templating/Helper/ActionsHelper.php | 3 +- .../Templating/TemplateNameParser.php | 2 +- .../Controller/RedirectControllerTest.php | 2 +- .../FrameworkBundle/Util/Filesystem.php | 4 +- .../Extension/TemplatingExtension.php | 3 +- .../Component/Config/Definition/ArrayNode.php | 2 +- .../Config/Definition/BooleanNode.php | 64 ++++---- .../Builder/NormalizationBuilder.php | 152 +++++++++--------- .../Definition/Builder/ValidationBuilder.php | 104 ++++++------ .../CssSelector/Node/CombinedSelectorNode.php | 6 +- .../CssSelector/Node/FunctionNode.php | 10 +- .../Component/CssSelector/Node/PseudoNode.php | 4 +- src/Symfony/Component/CssSelector/Parser.php | 10 +- .../Component/CssSelector/Tokenizer.php | 16 +- .../ResolveReferencesToAliasesPass.php | 5 +- .../DependencyInjection/Dumper/PhpDumper.php | 9 +- .../DependencyInjection/Dumper/XmlDumper.php | 6 +- .../Component/DependencyInjection/Scope.php | 58 +++---- .../DependencyInjection/ScopeInterface.php | 26 +-- src/Symfony/Component/DomCrawler/Crawler.php | 2 +- .../EntityFieldFactoryGuesser.php | 28 ++-- .../ValidatorFieldFactoryGuesser.php | 2 +- .../SessionStorage/PdoSessionStorage.php | 34 ++-- .../Routing/Loader/XmlFileLoader.php | 2 +- .../Security/Acl/Dbal/AclProvider.php | 3 +- .../Security/Acl/Dbal/MutableAclProvider.php | 3 +- .../Serializer/Encoder/XmlEncoder.php | 4 +- .../Templating/Loader/FilesystemLoader.php | 3 +- .../Translation/Loader/CsvFileLoader.php | 2 +- .../Validator/Constraints/RegexValidator.php | 3 +- .../Validator/Exception/MappingException.php | 5 +- .../Validator/Mapping/Loader/FilesLoader.php | 2 +- 46 files changed, 307 insertions(+), 317 deletions(-) diff --git a/src/Symfony/Bundle/DoctrineBundle/CacheWarmer/ProxyCacheWarmer.php b/src/Symfony/Bundle/DoctrineBundle/CacheWarmer/ProxyCacheWarmer.php index 8dc06639c18c..b67c941ca846 100644 --- a/src/Symfony/Bundle/DoctrineBundle/CacheWarmer/ProxyCacheWarmer.php +++ b/src/Symfony/Bundle/DoctrineBundle/CacheWarmer/ProxyCacheWarmer.php @@ -65,7 +65,7 @@ public function warmUp($cacheDir) } $entityManagers = $this->container->getParameter('doctrine.orm.entity_managers'); - foreach ($entityManagers AS $entityManagerName) { + foreach ($entityManagers as $entityManagerName) { $em = $this->container->get(sprintf('doctrine.orm.%s_entity_manager', $entityManagerName)); /* @var $em Doctrine\ORM\EntityManager */ $classes = $em->getMetadataFactory()->getAllMetadata(); diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php index 0f2ac56e9f0e..d045eba07e15 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php @@ -112,7 +112,7 @@ protected function getDoctrineEntityManagers() { $entityManagerNames = $this->container->getParameter('doctrine.orm.entity_managers'); $entityManagers = array(); - foreach ($entityManagerNames AS $entityManagerName) { + foreach ($entityManagerNames as $entityManagerName) { $em = $this->container->get(sprintf('doctrine.orm.%s_entity_manager', $entityManagerName)); $entityManagers[] = $em; } diff --git a/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php b/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php index e53443811d2e..702af0e3fe42 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php +++ b/src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php @@ -48,7 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $entityManagerName = $input->getOption('em') ? $input->getOption('em') : $this->container->getParameter('doctrine.orm.default_entity_manager'); -- + $entityManagerService = sprintf('doctrine.orm.%s_entity_manager', $entityManagerName); /* @var $entityManager Doctrine\ORM\EntityManager */ @@ -61,11 +61,11 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->write(sprintf("Found %d entities mapped in entity manager '%s':", count($entityClassNames), $entityManagerName), true); - foreach ($entityClassNames AS $entityClassName) { + foreach ($entityClassNames as $entityClassName) { try { $cm = $entityManager->getClassMetadata($entityClassName); $output->write("[OK] " . $entityClassName, true); - } catch(MappingException $e) { + } catch (MappingException $e) { $output->write("[FAIL] " . $entityClassName, true); $output->write("" . $e->getMessage()."", true); $output->write("", true); diff --git a/src/Symfony/Bundle/DoctrineBundle/ConnectionFactory.php b/src/Symfony/Bundle/DoctrineBundle/ConnectionFactory.php index ef8e0f482655..cb8c2df2894c 100644 --- a/src/Symfony/Bundle/DoctrineBundle/ConnectionFactory.php +++ b/src/Symfony/Bundle/DoctrineBundle/ConnectionFactory.php @@ -52,7 +52,7 @@ public function createConnection(array $params, Configuration $config = null, Ev private function initializeTypes() { - foreach ($this->typesConfig AS $type => $className) { + foreach ($this->typesConfig as $type => $className) { if (Type::hasType($type)) { Type::overrideType($type, $className); } else { diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php b/src/Symfony/Bundle/DoctrineBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php index aba2dd53dca0..af38a3f8319c 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php @@ -37,7 +37,7 @@ public function testWarmCache() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.orm.auto_generate_proxy_classes')) - ->will($this->returnValue( false )); + ->will($this->returnValue(false)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('doctrine.orm.entity_managers')) @@ -69,11 +69,11 @@ public function testSkipWhenProxiesAreAutoGenerated() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.orm.auto_generate_proxy_classes')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('assertion')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $cacheWarmer = new ProxyCacheWarmer($container); $cacheWarmer->warmUp(sys_get_temp_dir()); diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php index 94eceedaca31..f2477ee481ca 100755 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php @@ -710,7 +710,7 @@ protected function assertDICDefinitionMethodCallOnce($definition, $methodName, a { $calls = $definition->getMethodCalls(); $called = false; - foreach ($calls AS $call) { + foreach ($calls as $call) { if ($call[0] == $methodName) { if ($called) { $this->fail("Method '".$methodName."' is expected to be called only once, a second call was registered though."); diff --git a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php index 3f293ebc9bda..189ced1643fb 100644 --- a/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php +++ b/src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php @@ -8,7 +8,7 @@ static public function dataValidateSchemaFiles() { $schemaFiles = array(); $di = new \DirectoryIterator(__DIR__ . "/Fixtures/config/xml"); - foreach ($di AS $element) { + foreach ($di as $element) { if ($element->isFile() && strpos($element->getFilename(), ".xml") !== false) { $schemaFiles[] = array($element->getPathname()); } diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/HydratorCacheWarmer.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/HydratorCacheWarmer.php index 830c4db7776c..2accb2e844a1 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/HydratorCacheWarmer.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/HydratorCacheWarmer.php @@ -66,7 +66,7 @@ public function warmUp($cacheDir) } $documentManagers = $this->container->getParameter('doctrine.odm.mongodb.document_managers'); - foreach ($documentManagers AS $documentManagerName) { + foreach ($documentManagers as $documentManagerName) { $dm = $this->container->get(sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManagerName)); /* @var $dm Doctrine\ODM\MongoDB\DocumentManager */ $classes = $dm->getMetadataFactory()->getAllMetadata(); diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/ProxyCacheWarmer.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/ProxyCacheWarmer.php index 9f11f482d24c..3022efa65e78 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/ProxyCacheWarmer.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/CacheWarmer/ProxyCacheWarmer.php @@ -66,7 +66,7 @@ public function warmUp($cacheDir) } $documentManagers = $this->container->getParameter('doctrine.odm.mongodb.document_managers'); - foreach ($documentManagers AS $documentManagerName) { + foreach ($documentManagers as $documentManagerName) { $dm = $this->container->get(sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManagerName)); /* @var $dm Doctrine\ODM\MongoDB\DocumentManager */ $classes = $dm->getMetadataFactory()->getAllMetadata(); diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/DoctrineODMCommand.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/DoctrineODMCommand.php index 3896587d77c0..f9359fd2b368 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/DoctrineODMCommand.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Command/DoctrineODMCommand.php @@ -55,7 +55,7 @@ protected function getDoctrineDocumentManagers() { $documentManagerNames = $this->container->getParameter('doctrine.odm.mongodb.document_managers'); $documentManagers = array(); - foreach ($documentManagerNames AS $documentManagerName) { + foreach ($documentManagerNames as $documentManagerName) { $dm = $this->container->get(sprintf('doctrine.odm.mongodb.%s_document_manager', $documentManagerName)); $documentManagers[] = $dm; } diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php index 4703ad558223..f504cdec3855 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/DependencyInjection/DoctrineMongoDBExtension.php @@ -339,7 +339,7 @@ protected function loadDocumentManagerBundlesMappingInformation(array $documentM if ($odmConfigDef->hasMethodCall('setDocumentNamespaces')) { // TODO: Can we make a method out of it on Definition? replaceMethodArguments() or something. $calls = $odmConfigDef->getMethodCalls(); - foreach ($calls AS $call) { + foreach ($calls as $call) { if ($call[0] == 'setDocumentNamespaces') { $this->aliasMap = array_merge($call[1][0], $this->aliasMap); } diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/HydratorCacheWarmerTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/HydratorCacheWarmerTest.php index 250073342dab..5c169ad0cad4 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/HydratorCacheWarmerTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/HydratorCacheWarmerTest.php @@ -37,7 +37,7 @@ public function testWarmCache() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.auto_generate_hydrator_classes')) - ->will($this->returnValue( false )); + ->will($this->returnValue(false)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.document_managers')) @@ -72,11 +72,11 @@ public function testSkipWhenHydratorsAreAutoGenerated() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.auto_generate_hydrator_classes')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('assertion')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $cacheWarmer = new HydratorCacheWarmer($container); $cacheWarmer->warmUp(sys_get_temp_dir()); diff --git a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php index 7c5dfaf340cf..31e5057bf07e 100644 --- a/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php +++ b/src/Symfony/Bundle/DoctrineMongoDBBundle/Tests/CacheWarmer/ProxyCacheWarmerTest.php @@ -37,7 +37,7 @@ public function testWarmCache() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.auto_generate_proxy_classes')) - ->will($this->returnValue( false )); + ->will($this->returnValue(false)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.document_managers')) @@ -72,11 +72,11 @@ public function testSkipWhenProxiesAreAutoGenerated() $container->expects($this->at(1)) ->method('getParameter') ->with($this->equalTo('doctrine.odm.mongodb.auto_generate_proxy_classes')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $container->expects($this->at(2)) ->method('getParameter') ->with($this->equalTo('assertion')) - ->will($this->returnValue( true )); + ->will($this->returnValue(true)); $cacheWarmer = new ProxyCacheWarmer($container); $cacheWarmer->warmUp(sys_get_temp_dir()); diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php index f4cff3a028e3..fa2bbe9b78f4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/InternalController.php @@ -36,8 +36,7 @@ public function indexAction($path, $controller) $attributes->remove('path'); $attributes->remove('controller'); - if ('none' !== $path) - { + if ('none' !== $path) { parse_str($path, $tmp); $attributes->add($tmp); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php index bb8cd4c7dec3..2cc196483ba4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/ActionsHelper.php @@ -46,8 +46,7 @@ public function render($controller, array $attributes = array(), array $options { $options['attributes'] = $attributes; - if (isset($options['query'])) - { + if (isset($options['query'])) { $options['query'] = $options['query']; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php b/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php index 6a37d663efe6..b89f603b7bae 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/TemplateNameParser.php @@ -50,7 +50,7 @@ public function parse($name) } // normalize name - $name = str_replace(':/' , ':', preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'))); + $name = str_replace(':/', ':', preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'))); if (false !== strpos($name, '..')) { throw new \RuntimeException(sprintf('Template name "%s" contains invalid characters.', $name)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php index a7ba26f1e55f..c050cc0ea689 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php @@ -56,7 +56,7 @@ public function testRoute($permanent, $expectedCode) $router ->expects($this->once()) ->method('generate') - ->with($this->equalTo($route),$this->equalTo($params)) + ->with($this->equalTo($route), $this->equalTo($params)) ->will($this->returnValue($url)); $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Util/Filesystem.php b/src/Symfony/Bundle/FrameworkBundle/Util/Filesystem.php index abfd4fd4dda7..563f182b9791 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Util/Filesystem.php +++ b/src/Symfony/Bundle/FrameworkBundle/Util/Filesystem.php @@ -42,8 +42,8 @@ public function copy($originFile, $targetFile, $options = array()) $mostRecent = false; if (file_exists($targetFile)) { $statTarget = stat($targetFile); - $stat_origin = stat($originFile); - $mostRecent = ($stat_origin['mtime'] > $statTarget['mtime']) ? true : false; + $statOrigin = stat($originFile); + $mostRecent = $statOrigin['mtime'] > $statTarget['mtime']; } if ($options['override'] || !file_exists($targetFile) || $mostRecent) { diff --git a/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php index d7ecb93b6316..e4c1846fce9e 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php @@ -101,8 +101,7 @@ public function renderAction($controller, array $attributes = array(), array $op { $options['attributes'] = $attributes; - if (isset($options['query'])) - { + if (isset($options['query'])) { $options['query'] = $options['query']; } diff --git a/src/Symfony/Component/Config/Definition/ArrayNode.php b/src/Symfony/Component/Config/Definition/ArrayNode.php index 87a7b820992c..485300233c50 100644 --- a/src/Symfony/Component/Config/Definition/ArrayNode.php +++ b/src/Symfony/Component/Config/Definition/ArrayNode.php @@ -321,7 +321,7 @@ protected function finalizeValue($value) )); } - if ($child->hasDefaultValue()) { + if ($child->hasDefaultValue()) { $value[$name] = $child->getDefaultValue(); } diff --git a/src/Symfony/Component/Config/Definition/BooleanNode.php b/src/Symfony/Component/Config/Definition/BooleanNode.php index b4c8f59f6906..faf93ba8e822 100644 --- a/src/Symfony/Component/Config/Definition/BooleanNode.php +++ b/src/Symfony/Component/Config/Definition/BooleanNode.php @@ -1,33 +1,33 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition; - -use Symfony\Component\Config\Definition\Exception\InvalidTypeException; - -class BooleanNode extends ScalarNode -{ - /** - * {@inheritDoc} - */ - protected function validateType($value) - { - parent::validateType($value); - - if (!is_bool($value)) { - throw new InvalidTypeException(sprintf( - 'Invalid type for path "%s". Expected boolean, but got %s.', - $this->getPath(), - json_encode($value) - )); - } - } + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition; + +use Symfony\Component\Config\Definition\Exception\InvalidTypeException; + +class BooleanNode extends ScalarNode +{ + /** + * {@inheritDoc} + */ + protected function validateType($value) + { + parent::validateType($value); + + if (!is_bool($value)) { + throw new InvalidTypeException(sprintf( + 'Invalid type for path "%s". Expected boolean, but got %s.', + $this->getPath(), + json_encode($value) + )); + } + } } \ No newline at end of file diff --git a/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php b/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php index 194c05f1cf72..9408cae51642 100644 --- a/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php +++ b/src/Symfony/Component/Config/Definition/Builder/NormalizationBuilder.php @@ -1,77 +1,77 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class builds normalization conditions. - * - * @author Johannes M. Schmitt - */ -class NormalizationBuilder -{ - public $parent; - public $before; - public $remappings; - - /** - * Constructor - * - * @param Symfony\Component\Config\Definition\Builder\NodeBuilder $parent - */ - public function __construct($parent) - { - $this->parent = $parent; - - $this->keys = false; - - $this->remappings = - $this->before = - $this->after = array(); - } - - /** - * Registers a key to remap to its plural form. - * - * @param string $key The key to remap - * @param string $plural The plural of the key in case of irregular plural - * - * @return Symfony\Component\Config\Definition\Builder\NormalizationBuilder - */ - public function remap($key, $plural = null) - { - if (null === $plural) { - $plural = $key.'s'; - } - - $this->remappings[] = array($key, $plural); - - return $this; - } - - /** - * Registers a closure to run before the normalization or an expression builder to build it if null is provided. - * - * @param \Closure $closure - * - * @return Symfony\Component\Config\Definition\Builder\ExprBuilder|Symfony\Component\Config\Definition\Builder\NormalizationBuilder - */ - public function before(\Closure $closure = null) - { - if (null !== $closure) { - $this->before[] = $closure; - - return $this; - } - - return $this->before[] = new ExprBuilder($this->parent); - } + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class builds normalization conditions. + * + * @author Johannes M. Schmitt + */ +class NormalizationBuilder +{ + public $parent; + public $before; + public $remappings; + + /** + * Constructor + * + * @param Symfony\Component\Config\Definition\Builder\NodeBuilder $parent + */ + public function __construct($parent) + { + $this->parent = $parent; + + $this->keys = false; + + $this->remappings = + $this->before = + $this->after = array(); + } + + /** + * Registers a key to remap to its plural form. + * + * @param string $key The key to remap + * @param string $plural The plural of the key in case of irregular plural + * + * @return Symfony\Component\Config\Definition\Builder\NormalizationBuilder + */ + public function remap($key, $plural = null) + { + if (null === $plural) { + $plural = $key.'s'; + } + + $this->remappings[] = array($key, $plural); + + return $this; + } + + /** + * Registers a closure to run before the normalization or an expression builder to build it if null is provided. + * + * @param \Closure $closure + * + * @return Symfony\Component\Config\Definition\Builder\ExprBuilder|Symfony\Component\Config\Definition\Builder\NormalizationBuilder + */ + public function before(\Closure $closure = null) + { + if (null !== $closure) { + $this->before[] = $closure; + + return $this; + } + + return $this->before[] = new ExprBuilder($this->parent); + } } \ No newline at end of file diff --git a/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php b/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php index d297d1cfb363..ff2944d4f845 100644 --- a/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php +++ b/src/Symfony/Component/Config/Definition/Builder/ValidationBuilder.php @@ -1,53 +1,53 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Config\Definition\Builder; - -/** - * This class builds validation conditions. - * - * @author Christophe Coevoet - */ -class ValidationBuilder -{ - public $parent; - public $rules; - - /** - * Constructor - * - * @param Symfony\Component\Config\Definition\Builder\NodeBuilder $parent - */ - public function __construct($parent) - { - $this->parent = $parent; - - $this->rules = array(); - } - - /** - * Registers a closure to run as normalization or an expression builder to build it if null is provided. - * - * @param \Closure $closure - * - * @return Symfony\Component\Config\Definition\Builder\ExprBuilder|Symfony\Component\Config\Definition\Builder\ValidationBuilder - */ - public function rule(\Closure $closure = null) - { - if (null !== $closure) { - $this->rules[] = $closure; - - return $this; - } - - return $this->rules[] = new ExprBuilder($this->parent); - } + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Config\Definition\Builder; + +/** + * This class builds validation conditions. + * + * @author Christophe Coevoet + */ +class ValidationBuilder +{ + public $parent; + public $rules; + + /** + * Constructor + * + * @param Symfony\Component\Config\Definition\Builder\NodeBuilder $parent + */ + public function __construct($parent) + { + $this->parent = $parent; + + $this->rules = array(); + } + + /** + * Registers a closure to run as normalization or an expression builder to build it if null is provided. + * + * @param \Closure $closure + * + * @return Symfony\Component\Config\Definition\Builder\ExprBuilder|Symfony\Component\Config\Definition\Builder\ValidationBuilder + */ + public function rule(\Closure $closure = null) + { + if (null !== $closure) { + $this->rules[] = $closure; + + return $this; + } + + return $this->rules[] = new ExprBuilder($this->parent); + } } \ No newline at end of file diff --git a/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php b/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php index 80e88e130a51..428c1e1adc62 100644 --- a/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php +++ b/src/Symfony/Component/CssSelector/Node/CombinedSelectorNode.php @@ -23,7 +23,7 @@ */ class CombinedSelectorNode implements NodeInterface { - static protected $_method_mapping = array( + static protected $methodMapping = array( ' ' => 'descendant', '>' => 'child', '+' => 'direct_adjacent', @@ -64,11 +64,11 @@ public function __toString() */ public function toXpath() { - if (!isset(self::$_method_mapping[$this->combinator])) { + if (!isset(self::$methodMapping[$this->combinator])) { throw new SyntaxError(sprintf('Unknown combinator: %s', $this->combinator)); } - $method = '_xpath_'.self::$_method_mapping[$this->combinator]; + $method = '_xpath_'.self::$methodMapping[$this->combinator]; $path = $this->selector->toXpath(); return $this->$method($path, $this->subselector); diff --git a/src/Symfony/Component/CssSelector/Node/FunctionNode.php b/src/Symfony/Component/CssSelector/Node/FunctionNode.php index 8de049672d80..e666e33fae5f 100644 --- a/src/Symfony/Component/CssSelector/Node/FunctionNode.php +++ b/src/Symfony/Component/CssSelector/Node/FunctionNode.php @@ -61,7 +61,7 @@ public function __toString() */ public function toXpath() { - $sel_path = $this->selector->toXpath(); + $selPath = $this->selector->toXpath(); if (in_array($this->name, self::$unsupported)) { throw new SyntaxError(sprintf('The pseudo-class %s is not supported', $this->name)); } @@ -70,7 +70,7 @@ public function toXpath() throw new SyntaxError(sprintf('The pseudo-class %s is unknown', $this->name)); } - return $this->$method($sel_path, $this->expr); + return $this->$method($selPath, $this->expr); } /** @@ -113,13 +113,13 @@ protected function _xpath_nth_child($xpath, $expr, $last = false, $addNameTest = } if ($b > 0) { - $b_neg = -$b; + $bNeg = -$b; } else { - $b_neg = sprintf('+%s', -$b); + $bNeg = sprintf('+%s', -$b); } if ($a != 1) { - $expr = array(sprintf('(position() %s) mod %s = 0', $b_neg, $a)); + $expr = array(sprintf('(position() %s) mod %s = 0', $bNeg, $a)); } else { $expr = array(); } diff --git a/src/Symfony/Component/CssSelector/Node/PseudoNode.php b/src/Symfony/Component/CssSelector/Node/PseudoNode.php index d0d9166ca428..462a57b97c21 100644 --- a/src/Symfony/Component/CssSelector/Node/PseudoNode.php +++ b/src/Symfony/Component/CssSelector/Node/PseudoNode.php @@ -67,7 +67,7 @@ public function __toString() */ public function toXpath() { - $el_xpath = $this->element->toXpath(); + $elXpath = $this->element->toXpath(); if (in_array($this->ident, self::$unsupported)) { throw new SyntaxError(sprintf('The pseudo-class %s is unsupported', $this->ident)); @@ -77,7 +77,7 @@ public function toXpath() throw new SyntaxError(sprintf('The pseudo-class %s is unknown', $this->ident)); } - return $this->$method($el_xpath); + return $this->$method($elXpath); } /** diff --git a/src/Symfony/Component/CssSelector/Parser.php b/src/Symfony/Component/CssSelector/Parser.php index 612e556d2607..baf266c2bbd4 100644 --- a/src/Symfony/Component/CssSelector/Parser.php +++ b/src/Symfony/Component/CssSelector/Parser.php @@ -147,12 +147,12 @@ protected function parseSelector($stream) $combinator = ' '; } $consumed = count($stream->getUsed()); - $next_selector = $this->parseSimpleSelector($stream); + $nextSelector = $this->parseSimpleSelector($stream); if ($consumed == count($stream->getUsed())) { throw new SyntaxError(sprintf("Expected selector, got '%s'", $stream->peek())); } - $result = new Node\CombinedSelectorNode($result, $combinator, $next_selector); + $result = new Node\CombinedSelectorNode($result, $combinator, $nextSelector); } return $result; @@ -193,11 +193,11 @@ protected function parseSimpleSelector($stream) } $result = new Node\ElementNode($namespace, $element); - $has_hash = false; + $hasHash = false; while (true) { $peek = $stream->peek(); if ('#' == $peek) { - if ($has_hash) { + if ($hasHash) { /* You can't have two hashes (FIXME: is there some more general rule I'm missing?) */ // @codeCoverageIgnoreStart @@ -206,7 +206,7 @@ protected function parseSimpleSelector($stream) } $stream->next(); $result = new Node\HashNode($result, $stream->next()); - $has_hash = true; + $hasHash = true; continue; } elseif ('.' == $peek) { diff --git a/src/Symfony/Component/CssSelector/Tokenizer.php b/src/Symfony/Component/CssSelector/Tokenizer.php index 0fea426f19d2..30f6294e6390 100644 --- a/src/Symfony/Component/CssSelector/Tokenizer.php +++ b/src/Symfony/Component/CssSelector/Tokenizer.php @@ -42,10 +42,10 @@ public function tokenize($s) while (true) { if (preg_match('#\s+#A', $s, $match, 0, $pos)) { - $preceding_whitespace_pos = $pos; + $precedingWhitespacePos = $pos; $pos += strlen($match[0]); } else { - $preceding_whitespace_pos = 0; + $precedingWhitespacePos = 0; } if ($pos >= strlen($s)) { @@ -74,8 +74,8 @@ public function tokenize($s) } if (in_array($c, array('>', '+', '~', ',', '.', '*', '=', '[', ']', '(', ')', '|', ':', '#'))) { - if (in_array($c, array('.', '#', '[')) && $preceding_whitespace_pos > 0) { - $tokens[] = new Token('Token', ' ', $preceding_whitespace_pos); + if (in_array($c, array('.', '#', '[')) && $precedingWhitespacePos > 0) { + $tokens[] = new Token('Token', ' ', $precedingWhitespacePos); } $tokens[] = new Token('Token', $c, $pos); ++$pos; @@ -85,18 +85,18 @@ public function tokenize($s) if ('"' === $c || "'" === $c) { // Quoted string - $old_pos = $pos; + $oldPos = $pos; list($sym, $pos) = $this->tokenizeEscapedString($s, $pos); - $tokens[] = new Token('String', $sym, $old_pos); + $tokens[] = new Token('String', $sym, $oldPos); continue; } - $old_pos = $pos; + $oldPos = $pos; list($sym, $pos) = $this->tokenizeSymbol($s, $pos); - $tokens[] = new Token('Symbol', $sym, $old_pos); + $tokens[] = new Token('Symbol', $sym, $oldPos); continue; } diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php index a2bd3f6add79..e307d553f409 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveReferencesToAliasesPass.php @@ -33,8 +33,7 @@ public function process(ContainerBuilder $container) { $this->container = $container; - foreach ($container->getDefinitions() as $definition) - { + foreach ($container->getDefinitions() as $definition) { if ($definition->isSynthetic() || $definition->isAbstract()) { continue; } @@ -62,7 +61,7 @@ protected function processArguments(array $arguments) foreach ($arguments as $k => $argument) { if (is_array($argument)) { $arguments[$k] = $this->processArguments($argument); - } else if ($argument instanceof Reference) { + } elseif ($argument instanceof Reference) { $defId = $this->getDefinitionId($id = (string) $argument); if ($defId !== $id) { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 1442f4f43ce8..fae9700a9fd8 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1094,19 +1094,16 @@ protected function getNextVariableName() $nonFirstChars = self::NON_FIRST_CHARS; $nonFirstCharsLength = strlen($nonFirstChars); - while (true) - { + while (true) { $name = ''; $i = $this->variableCount; - if ('' === $name) - { + if ('' === $name) { $name .= $firstChars[$i%$firstCharsLength]; $i = intval($i/$firstCharsLength); } - while ($i > 0) - { + while ($i > 0) { $i -= 1; $name .= $nonFirstChars[$i%$nonFirstCharsLength]; $i = intval($i/$nonFirstCharsLength); diff --git a/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php index c095769052b8..de27bf932cc3 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php @@ -150,13 +150,13 @@ protected function addService($definition, $id, \DOMElement $parent) $service->setAttribute('class', $definition->getClass()); } if ($definition->getFactoryMethod()) { - $service->setAttribute ('factory-method', $definition->getFactoryMethod()); + $service->setAttribute('factory-method', $definition->getFactoryMethod()); } if ($definition->getFactoryService()) { - $service->setAttribute ('factory-service', $definition->getFactoryService()); + $service->setAttribute('factory-service', $definition->getFactoryService()); } if (ContainerInterface::SCOPE_CONTAINER !== $scope = $definition->getScope()) { - $service->setAttribute ('scope', $scope); + $service->setAttribute('scope', $scope); } foreach ($definition->getTags() as $name => $tags) { diff --git a/src/Symfony/Component/DependencyInjection/Scope.php b/src/Symfony/Component/DependencyInjection/Scope.php index fd43751ebe6a..1af4e2834e3a 100644 --- a/src/Symfony/Component/DependencyInjection/Scope.php +++ b/src/Symfony/Component/DependencyInjection/Scope.php @@ -1,30 +1,30 @@ - - */ -class Scope implements ScopeInterface -{ - protected $name; - protected $parentName; - - public function __construct($name, $parentName = ContainerInterface::SCOPE_CONTAINER) - { - $this->name = $name; - $this->parentName = $parentName; - } - - public function getName() - { - return $this->name; - } - - public function getParentName() - { - return $this->parentName; - } + + */ +class Scope implements ScopeInterface +{ + protected $name; + protected $parentName; + + public function __construct($name, $parentName = ContainerInterface::SCOPE_CONTAINER) + { + $this->name = $name; + $this->parentName = $parentName; + } + + public function getName() + { + return $this->name; + } + + public function getParentName() + { + return $this->parentName; + } } \ No newline at end of file diff --git a/src/Symfony/Component/DependencyInjection/ScopeInterface.php b/src/Symfony/Component/DependencyInjection/ScopeInterface.php index 59a893c9b6f5..b0f2911f677e 100644 --- a/src/Symfony/Component/DependencyInjection/ScopeInterface.php +++ b/src/Symfony/Component/DependencyInjection/ScopeInterface.php @@ -1,14 +1,14 @@ - - */ -interface ScopeInterface -{ - function getName(); - function getParentName(); + + */ +interface ScopeInterface +{ + function getName(); + function getParentName(); } \ No newline at end of file diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index 9918a5026dbc..f8a7b27dd903 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -592,7 +592,7 @@ protected function sibling($node, $siblingDir = 'nextSibling') if ($node !== $this->getNode(0) && $node->nodeType === 1) { $nodes[] = $node; } - } while($node = $node->$siblingDir); + } while ($node = $node->$siblingDir); return $nodes; } diff --git a/src/Symfony/Component/Form/FieldFactory/EntityFieldFactoryGuesser.php b/src/Symfony/Component/Form/FieldFactory/EntityFieldFactoryGuesser.php index 3e716d6a9c87..8dd25fd7fbe6 100644 --- a/src/Symfony/Component/Form/FieldFactory/EntityFieldFactoryGuesser.php +++ b/src/Symfony/Component/Form/FieldFactory/EntityFieldFactoryGuesser.php @@ -37,9 +37,9 @@ public function __construct(EntityManager $em) } /** - * Returns whether Doctrine 2 metadata exists for that class - * - * @return boolean + * Returns whether Doctrine 2 metadata exists for that class + * + * @return boolean */ protected function isMappedClass($class) { @@ -59,7 +59,7 @@ public function guessClass($class, $property) $mapping = $metadata->getAssociationMapping($property); return new FieldFactoryClassGuess( - 'Symfony\Component\Form\EntityChoiceField', + 'Symfony\Component\Form\EntityChoiceField', array( 'em' => $this->em, 'class' => $mapping['targetEntity'], @@ -72,13 +72,13 @@ public function guessClass($class, $property) { // case 'array': // return new FieldFactoryClassGuess( - // 'Symfony\Component\Form\CollectionField', + // 'Symfony\Component\Form\CollectionField', // array(), // FieldFactoryGuess::HIGH_CONFIDENCE // ); case 'boolean': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\CheckboxField', + 'Symfony\Component\Form\CheckboxField', array(), FieldFactoryGuess::HIGH_CONFIDENCE ); @@ -86,20 +86,20 @@ public function guessClass($class, $property) case 'vardatetime': case 'datetimetz': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\DateTimeField', + 'Symfony\Component\Form\DateTimeField', array(), FieldFactoryGuess::HIGH_CONFIDENCE ); case 'date': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\DateField', + 'Symfony\Component\Form\DateField', array(), FieldFactoryGuess::HIGH_CONFIDENCE ); case 'decimal': case 'float': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\NumberField', + 'Symfony\Component\Form\NumberField', array(), FieldFactoryGuess::MEDIUM_CONFIDENCE ); @@ -107,25 +107,25 @@ public function guessClass($class, $property) case 'bigint': case 'smallint': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\IntegerField', + 'Symfony\Component\Form\IntegerField', array(), FieldFactoryGuess::MEDIUM_CONFIDENCE ); case 'string': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\TextField', + 'Symfony\Component\Form\TextField', array(), FieldFactoryGuess::MEDIUM_CONFIDENCE ); case 'text': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\TextareaField', + 'Symfony\Component\Form\TextareaField', array(), FieldFactoryGuess::MEDIUM_CONFIDENCE ); case 'time': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\TimeField', + 'Symfony\Component\Form\TimeField', array(), FieldFactoryGuess::HIGH_CONFIDENCE ); @@ -135,7 +135,7 @@ public function guessClass($class, $property) } return new FieldFactoryClassGuess( - 'Symfony\Component\Form\TextField', + 'Symfony\Component\Form\TextField', array(), FieldFactoryGuess::LOW_CONFIDENCE ); diff --git a/src/Symfony/Component/Form/FieldFactory/ValidatorFieldFactoryGuesser.php b/src/Symfony/Component/Form/FieldFactory/ValidatorFieldFactoryGuesser.php index b4964cf52bdf..0882766de8c6 100644 --- a/src/Symfony/Component/Form/FieldFactory/ValidatorFieldFactoryGuesser.php +++ b/src/Symfony/Component/Form/FieldFactory/ValidatorFieldFactoryGuesser.php @@ -142,7 +142,7 @@ public function guessClassForConstraint(Constraint $constraint) ); case '\DateTime': return new FieldFactoryClassGuess( - 'Symfony\Component\Form\DateField', + 'Symfony\Component\Form\DateField', array(), FieldFactoryGuess::MEDIUM_CONFIDENCE ); diff --git a/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php b/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php index 348ba170ad8f..2e3db13979b0 100644 --- a/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/SessionStorage/PdoSessionStorage.php @@ -97,11 +97,11 @@ public function sessionClose() public function sessionDestroy($id) { // get table/column - $db_table = $this->options['db_table']; - $db_id_col = $this->options['db_id_col']; + $dbTable = $this->options['db_table']; + $dbIdCol = $this->options['db_id_col']; // delete the record associated with this id - $sql = 'DELETE FROM '.$db_table.' WHERE '.$db_id_col.'= ?'; + $sql = 'DELETE FROM '.$dbTable.' WHERE '.$dbIdCol.'= ?'; try { $stmt = $this->db->prepare($sql); @@ -126,11 +126,11 @@ public function sessionDestroy($id) public function sessionGC($lifetime) { // get table/column - $db_table = $this->options['db_table']; - $db_time_col = $this->options['db_time_col']; + $dbTable = $this->options['db_table']; + $dbTimeCol = $this->options['db_time_col']; // delete the record associated with this id - $sql = 'DELETE FROM '.$db_table.' WHERE '.$db_time_col.' < '.(time() - $lifetime); + $sql = 'DELETE FROM '.$dbTable.' WHERE '.$dbTimeCol.' < '.(time() - $lifetime); try { $this->db->query($sql); @@ -153,13 +153,13 @@ public function sessionGC($lifetime) public function sessionRead($id) { // get table/columns - $db_table = $this->options['db_table']; - $db_data_col = $this->options['db_data_col']; - $db_id_col = $this->options['db_id_col']; - $db_time_col = $this->options['db_time_col']; + $dbTable = $this->options['db_table']; + $dbDataCol = $this->options['db_data_col']; + $dbIdCol = $this->options['db_id_col']; + $dbTimeCol = $this->options['db_time_col']; try { - $sql = 'SELECT '.$db_data_col.' FROM '.$db_table.' WHERE '.$db_id_col.'=?'; + $sql = 'SELECT '.$dbDataCol.' FROM '.$dbTable.' WHERE '.$dbIdCol.'=?'; $stmt = $this->db->prepare($sql); $stmt->bindParam(1, $id, \PDO::PARAM_STR, 255); @@ -173,7 +173,7 @@ public function sessionRead($id) return $sessionRows[0][0]; } else { // session does not exist, create it - $sql = 'INSERT INTO '.$db_table.'('.$db_id_col.', '.$db_data_col.', '.$db_time_col.') VALUES (?, ?, ?)'; + $sql = 'INSERT INTO '.$dbTable.'('.$dbIdCol.', '.$dbDataCol.', '.$dbTimeCol.') VALUES (?, ?, ?)'; $stmt = $this->db->prepare($sql); $stmt->bindParam(1, $id, \PDO::PARAM_STR); @@ -201,12 +201,12 @@ public function sessionRead($id) public function sessionWrite($id, $data) { // get table/column - $db_table = $this->options['db_table']; - $db_data_col = $this->options['db_data_col']; - $db_id_col = $this->options['db_id_col']; - $db_time_col = $this->options['db_time_col']; + $dbTable = $this->options['db_table']; + $dbDataCol = $this->options['db_data_col']; + $dbIdCol = $this->options['db_id_col']; + $dbTimeCol = $this->options['db_time_col']; - $sql = 'UPDATE '.$db_table.' SET '.$db_data_col.' = ?, '.$db_time_col.' = '.time().' WHERE '.$db_id_col.'= ?'; + $sql = 'UPDATE '.$dbTable.' SET '.$dbDataCol.' = ?, '.$dbTimeCol.' = '.time().' WHERE '.$dbIdCol.'= ?'; try { $stmt = $this->db->prepare($sql); diff --git a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php index 9d6b7a94d778..9ccb16dfdb69 100644 --- a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -103,7 +103,7 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $definiti switch ($node->tagName) { case 'default': $defaults[(string) $node->getAttribute('key')] = trim((string) $node->nodeValue); - break; + break; case 'option': $options[(string) $node->getAttribute('key')] = trim((string) $node->nodeValue); break; diff --git a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php index c45a597decde..f88359991883 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php @@ -437,8 +437,7 @@ protected function hydrateObjectIdentities(Statement $stmt, array $oidLookup, ar // fill-in parent ACLs where this hasn't been done yet cause the parent ACL was not // yet available $processed = 0; - foreach ($parentIdToFill as $acl) - { + foreach ($parentIdToFill as $acl) { $parentId = $parentIdToFill->offsetGet($acl); // let's see if we have already hydrated this diff --git a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php index da5ded92e2c3..3a8eebc16c81 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php @@ -860,8 +860,7 @@ protected function updateAceProperty($name, array $changes) */ protected function updateAces(\SplObjectStorage $aces) { - foreach ($aces as $ace) - { + foreach ($aces as $ace) { $propertyChanges = $aces->offsetGet($ace); $sets = array(); diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index f951d2ecd501..2b13dee61354 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -133,13 +133,13 @@ protected function buildXml($parentNode, $data) if (is_array($data) || $data instanceof \Traversable) { foreach ($data as $key => $data) { //Ah this is the magic @ attribute types. - if (strpos($key,"@")===0 && is_scalar($data) && $this->isElementNameValid($attributeName = substr($key,1))) { + if (0 === strpos($key, "@") && is_scalar($data) && $this->isElementNameValid($attributeName = substr($key,1))) { $parentNode->setAttribute($attributeName, $data); } elseif (is_array($data) && false === is_numeric($key)) { /** * Is this array fully numeric keys? */ - if (ctype_digit( implode('', array_keys($data) ) )) { + if (ctype_digit(implode('', array_keys($data)))) { /** * Create nodes to append to $parentNode based on the $key of this array * Produces 01 diff --git a/src/Symfony/Component/Templating/Loader/FilesystemLoader.php b/src/Symfony/Component/Templating/Loader/FilesystemLoader.php index 4c5388f68664..b9538ca4f863 100644 --- a/src/Symfony/Component/Templating/Loader/FilesystemLoader.php +++ b/src/Symfony/Component/Templating/Loader/FilesystemLoader.php @@ -90,8 +90,7 @@ public function load(TemplateReferenceInterface $template) */ public function isFresh(TemplateReferenceInterface $template, $time) { - if (false === $storage = $this->load($template)) - { + if (false === $storage = $this->load($template)) { return false; } diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php index efa2e466faba..2e788b3434bb 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -31,7 +31,7 @@ public function load($resource, $locale, $domain = 'messages') throw new \InvalidArgumentException(sprintf('Error opening file "%s".', $resource)); } - while(($data = fgetcsv($file, 0, ';')) !== false) { + while (($data = fgetcsv($file, 0, ';')) !== false) { if (substr($data[0], 0, 1) === '#') { continue; } diff --git a/src/Symfony/Component/Validator/Constraints/RegexValidator.php b/src/Symfony/Component/Validator/Constraints/RegexValidator.php index a15b743fef6d..2063acab546b 100644 --- a/src/Symfony/Component/Validator/Constraints/RegexValidator.php +++ b/src/Symfony/Component/Validator/Constraints/RegexValidator.php @@ -33,8 +33,7 @@ public function isValid($value, Constraint $constraint) ($constraint->match && !preg_match($constraint->pattern, $value)) || (!$constraint->match && preg_match($constraint->pattern, $value)) - ) - { + ) { $this->setMessage($constraint->message, array('{{ value }}' => $value)); return false; diff --git a/src/Symfony/Component/Validator/Exception/MappingException.php b/src/Symfony/Component/Validator/Exception/MappingException.php index eecc456c7542..6ceb9126949e 100644 --- a/src/Symfony/Component/Validator/Exception/MappingException.php +++ b/src/Symfony/Component/Validator/Exception/MappingException.php @@ -11,5 +11,6 @@ namespace Symfony\Component\Validator\Exception; -class MappingException extends ValidatorException { -} \ No newline at end of file +class MappingException extends ValidatorException +{ +} diff --git a/src/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php b/src/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php index daf30f668ee9..3f26204b8504 100644 --- a/src/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php +++ b/src/Symfony/Component/Validator/Mapping/Loader/FilesLoader.php @@ -43,7 +43,7 @@ public function __construct(array $paths) protected function getFileLoaders($paths) { $loaders = array(); - foreach ($paths as $path) { + foreach ($paths as $path) { $loaders[] = $this->getFileLoaderInstance($path); } return $loaders; 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