diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 324611fba1..2dd139750c 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -138,7 +138,6 @@ abstract class DoctrineType extends AbstractType $type = $this; $choiceLoader = function (Options $options) use ($choiceListFactory, &$choiceLoaders, $type) { - // Unless the choices are given explicitly, load them on demand if (null === $options['choices']) { $hash = null; diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index 760c0fada0..f917f73eaa 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -44,7 +44,7 @@ class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase $this->extension->expects($this->any()) ->method('getObjectManagerElementName') ->will($this->returnCallback(function ($name) { - return 'doctrine.orm.'.$name; + return 'doctrine.orm.'.$name; })); } diff --git a/src/Symfony/Bridge/Twig/Command/DebugCommand.php b/src/Symfony/Bridge/Twig/Command/DebugCommand.php index 898e0e2233..39b910d6b4 100644 --- a/src/Symfony/Bridge/Twig/Command/DebugCommand.php +++ b/src/Symfony/Bridge/Twig/Command/DebugCommand.php @@ -60,7 +60,7 @@ class DebugCommand extends Command new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (text or json)', 'text'), )) ->setDescription('Shows a list of twig functions, filters, globals and tests') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command outputs a list of twig functions, filters, globals and tests. Output can be filtered with an optional argument. diff --git a/src/Symfony/Bridge/Twig/Command/LintCommand.php b/src/Symfony/Bridge/Twig/Command/LintCommand.php index 4ed63241b8..83f4e1948c 100644 --- a/src/Symfony/Bridge/Twig/Command/LintCommand.php +++ b/src/Symfony/Bridge/Twig/Command/LintCommand.php @@ -61,7 +61,7 @@ class LintCommand extends Command ->setDescription('Lints a template and outputs encountered errors') ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') ->addArgument('filename', InputArgument::IS_ARRAY) - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command lints a template and outputs to STDOUT the first encountered syntax error. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php index 20deffcc33..9059905e04 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php @@ -39,7 +39,7 @@ class ConfigDebugCommand extends AbstractConfigCommand new InputArgument('name', InputArgument::OPTIONAL, 'The bundle name or the extension alias'), )) ->setDescription('Dumps the current configuration for an extension') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command dumps the current configuration for an extension/bundle. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php index f30b59cf62..f9bc810d0f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php @@ -38,7 +38,7 @@ class EventDispatcherDebugCommand extends ContainerAwareCommand new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw description'), )) ->setDescription('Displays configured listeners for an application') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command displays all configured listeners: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php index 04906317fa..2c45de9168 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStartCommand.php @@ -39,7 +39,7 @@ class ServerStartCommand extends ServerCommand )) ->setName('server:start') ->setDescription('Starts PHP built-in web server in the background') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% runs PHP's built-in web server: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php index 9b0656c220..84ed54c41e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ServerStopCommand.php @@ -33,7 +33,7 @@ class ServerStopCommand extends ServerCommand )) ->setName('server:stop') ->setDescription('Stops PHP\'s built-in web server that was started with the server:start command') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% stops PHP's built-in web server: php %command.full_name% diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php index 30d44493d4..64beda5265 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php @@ -50,7 +50,7 @@ class TranslationDebugCommand extends ContainerAwareCommand new InputOption('only-unused', null, InputOption::VALUE_NONE, 'Displays only unused messages'), )) ->setDescription('Displays translation messages information') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command helps finding unused or missing translation messages and comparing them with the fallback ones by inspecting the templates and translation files of a given bundle or the app folder. diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index b41f5f3479..ca39257462 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -34,7 +34,7 @@ class YamlLintCommand extends Command ->setDescription('Lints a file and outputs encountered errors') ->addArgument('filename', null, 'A file or a directory or STDIN') ->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format', 'txt') - ->setHelp(<<setHelp(<<<'EOF' The %command.name% command lints a YAML file and outputs to STDOUT the first encountered syntax error. diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php index 324eb4782c..bf4a4c4785 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/number_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php index 4390687a69..ec96cfb46b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/password_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'password')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php index 59b29f4cbc..8519da429b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/percent_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> % +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'text')) ?> % diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php index 1575e82928..e8fa18e488 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/reset_widget.html.php @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> +block($form, 'button_widget', array('type' => isset($type) ? $type : 'reset')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php index 4e442f6ef4..48a33f4aa2 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/search_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'search')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php index d42bb2a78f..6bf71f5a1e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/submit_widget.html.php @@ -1 +1 @@ -block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> +block($form, 'button_widget', array('type' => isset($type) ? $type : 'submit')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php index 0ce4ed2ca7..9e26318497 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/url_widget.html.php @@ -1 +1 @@ -block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?> +block($form, 'form_widget_simple', array('type' => isset($type) ? $type : 'url')) ?> diff --git a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php index c0b68a2d17..4ef5f0a4bd 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php +++ b/src/Symfony/Bundle/FrameworkBundle/Routing/Router.php @@ -164,7 +164,6 @@ class Router extends BaseRouter implements WarmableInterface gettype($resolved) ) ); - }, $value); return str_replace('%%', '%', $escapedValue); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php index 93c2468dc1..fc7e215553 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/RouterMatchCommandTest.php @@ -88,7 +88,6 @@ class RouterMatchCommandTest extends \PHPUnit_Framework_TestCase ->will($this->returnValueMap(array( array('router', 1, $router), array('controller_name_converter', 1, $loader), - ))); return $container; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php index c99c0ace2a..27f61c4383 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationDebugCommandTest.php @@ -136,7 +136,7 @@ class TranslationDebugCommandTest extends \PHPUnit_Framework_TestCase ->method('extract') ->will( $this->returnCallback(function ($path, $catalogue) use ($extractedMessages) { - $catalogue->add($extractedMessages); + $catalogue->add($extractedMessages); }) ); @@ -146,7 +146,7 @@ class TranslationDebugCommandTest extends \PHPUnit_Framework_TestCase ->method('loadMessages') ->will( $this->returnCallback(function ($path, $catalogue) use ($loadedMessages) { - $catalogue->add($loadedMessages); + $catalogue->add($loadedMessages); }) ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php index a04a0cccad..24a4f625f6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/TranslationUpdateCommandTest.php @@ -74,7 +74,7 @@ class TranslationUpdateCommandTest extends \PHPUnit_Framework_TestCase ->method('extract') ->will( $this->returnCallback(function ($path, $catalogue) use ($extractedMessages) { - $catalogue->add($extractedMessages); + $catalogue->add($extractedMessages); }) ); @@ -84,7 +84,7 @@ class TranslationUpdateCommandTest extends \PHPUnit_Framework_TestCase ->method('loadMessages') ->will( $this->returnCallback(function ($path, $catalogue) use ($loadedMessages) { - $catalogue->add($loadedMessages); + $catalogue->add($loadedMessages); }) ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php index 192ba44bf7..46249c8e7c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php @@ -141,6 +141,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase } abstract protected function getDescriptor(); + abstract protected function getFormat(); private function assertDescription($expectedDescription, $describedObject, array $options = array()) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php index 52a6665416..d6fc8b24ad 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php @@ -191,9 +191,11 @@ class CallableClass public function __invoke() { } + public static function staticMethod() { } + public function method() { } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php index 04df261863..c0ae6ec5c6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/views/translation.html.php @@ -1,7 +1,7 @@ This template is used for translation message extraction tests trans('single-quoted key') ?> trans('double-quoted key') ?> -trans(<<trans(<<<'EOF' heredoc key EOF ) ?> diff --git a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php index bd81d49271..092c627fa9 100644 --- a/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php +++ b/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php @@ -81,7 +81,7 @@ class SecurityDataCollector extends DataCollector 'authenticated' => $token->isAuthenticated(), 'token_class' => get_class($token), 'user' => $token->getUsername(), - 'roles' => array_map(function (RoleInterface $role) { return $role->getRole();}, $assignedRoles), + 'roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $assignedRoles), 'inherited_roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $inheritedRoles), 'supports_role_hierarchy' => null !== $this->roleHierarchy, ); diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php index 2b3310c61a..028e885246 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SecurityFactoryInterface.php @@ -25,7 +25,7 @@ interface SecurityFactoryInterface * Configures the container services required to use the authentication listener. * * @param ContainerBuilder $container - * @param string $id The unique id of the firewall + * @param string $id The unique id of the firewall * @param array $config The options array for the listener * @param string $userProvider The service id of the user provider * @param string $defaultEntryPoint @@ -48,7 +48,7 @@ interface SecurityFactoryInterface /** * Defines the configuration key used to reference the provider * in the firewall configuration. - * + * * @return string */ public function getKey(); diff --git a/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php b/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php index 7bef647a7e..e4a47a0769 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/Controller/PreviewErrorControllerTest.php @@ -34,7 +34,6 @@ class PreviewErrorControllerTest extends TestCase ->method('handle') ->with( $this->callback(function (Request $request) use ($self, $logicalControllerName, $code) { - $self->assertEquals($logicalControllerName, $request->attributes->get('_controller')); $exception = $request->attributes->get('exception'); diff --git a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php index ff043f1862..42207b0399 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Dumper/XmlReferenceDumperTest.php @@ -34,7 +34,7 @@ class XmlReferenceDumperTest extends \PHPUnit_Framework_TestCase private function getConfigurationAsString() { - return str_replace("\n", PHP_EOL, << diff --git a/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php index cf9ad13a78..4875f79285 100644 --- a/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/LegacyTableHelperTest.php @@ -112,7 +112,7 @@ TABLE array('ISBN', 'Title', 'Author'), $books, TableHelper::LAYOUT_COMPACT, -<<42';" OUT 42 RES Command ran successfully EOT; - $successOutputProcessDebug = <<getOutputStream()); @@ -588,7 +586,6 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase rewind($output->getStream()); $this->assertEquals( - " \033[44;37m Starting the demo... fingers crossed \033[0m\n". ' 0/15 '.$progress.str_repeat($empty, 26)." 0%\n". " \xf0\x9f\x8f\x81 < 1 sec \033[44;37m 0 B \033[0m" diff --git a/src/Symfony/Component/Console/Tests/Helper/TableTest.php b/src/Symfony/Component/Console/Tests/Helper/TableTest.php index 9628bc36fa..a691405c6b 100644 --- a/src/Symfony/Component/Console/Tests/Helper/TableTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/TableTest.php @@ -96,7 +96,7 @@ class TableTest extends \PHPUnit_Framework_TestCase array('ISBN', 'Title', 'Author'), $books, 'default', -<<
Charles Dickens'), ), 'default', -<<
render(); $expected = -<<
render(); $expected = -<<
render(); $expected = -<<
position += $length; } - /** - */ public function moveToEnd() { $this->position = $this->length; diff --git a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt index 4d41417b43..15e183a706 100644 --- a/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt +++ b/src/Symfony/Component/Debug/Resources/ext/tests/001.phpt @@ -1,14 +1,14 @@ --TEST-- Test symfony_zval_info API --SKIPIF-- - + --FILE-- $int, - 'float' => $float, - 'str' => $str, - 'object' => $object, - 'array' => $array, - 'resource' => $resource, - 'null' => $null, - 'bool' => $bool, - 'refcount' => &$refcount2); +$var = array( + 'int' => $int, + 'float' => $float, + 'str' => $str, + 'object' => $object, + 'array' => $array, + 'resource' => $resource, + 'null' => $null, + 'bool' => $bool, + 'refcount' => &$refcount2, +); var_dump(symfony_zval_info('int', $var)); var_dump(symfony_zval_info('float', $var)); diff --git a/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt b/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt index ebe2f32d8f..2bc6d71274 100644 --- a/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt +++ b/src/Symfony/Component/Debug/Resources/ext/tests/002.phpt @@ -1,7 +1,7 @@ --TEST-- Test symfony_debug_backtrace in case of fatal error --SKIPIF-- - + --FILE-- + --FILE-- + --FILE-- diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 6b49b1e34f..eab8fccbdf 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -756,12 +756,11 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase { $loader = new ClosureLoader($container = new ContainerBuilder()); $loader->load(function (ContainerBuilder $container) { - $container->set('a', new \BazClass()); - $definition = new Definition('BazClass'); - $definition->setLazy(true); - $container->setDefinition('a', $definition); - } - ); + $container->set('a', new \BazClass()); + $definition = new Definition('BazClass'); + $definition->setLazy(true); + $container->setDefinition('a', $definition); + }); $container->setResourceTracking(true); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php index 5fa06a0eb5..c675478fd6 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/createphar.php @@ -6,7 +6,7 @@ if (is_file($file)) { } $phar = new Phar($file, 0, 'ProjectWithXsdExtensionInPhar.phar'); -$phar->addFromString('ProjectWithXsdExtensionInPhar.php', <<addFromString('ProjectWithXsdExtensionInPhar.php', <<<'EOT' addFromString('schema/project-1.0.xsd', <<addFromString('schema/project-1.0.xsd', <<<'EOT' createForm('
'.$form.''); $this->assertEquals( $values, - array_map(function ($field) { + array_map( + function ($field) { $class = get_class($field); return array(substr($class, strrpos($class, '\\') + 1), $field->getValue()); diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 4aa6226e49..9717099bf9 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -25,7 +25,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $listeners = $dispatcher->getListeners('foo'); $this->assertCount(1, $listeners); $this->assertSame($listener, $listeners[0]); @@ -39,7 +39,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); } @@ -51,7 +51,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertFalse($dispatcher->hasListeners('foo')); $this->assertFalse($tdispatcher->hasListeners('foo')); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertTrue($dispatcher->hasListeners('foo')); $this->assertTrue($tdispatcher->hasListeners('foo')); } @@ -76,7 +76,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase { $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () {; }); + $tdispatcher->addListener('foo', $listener = function () { }); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getNotCalledListeners()); @@ -107,8 +107,8 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); - $tdispatcher->addListener('foo', $listener1 = function () {; }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener1 = function () { }); + $tdispatcher->addListener('foo', $listener2 = function () { }); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Notified event "foo" to listener "closure".'); @@ -123,7 +123,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); - $tdispatcher->addListener('foo', $listener2 = function () {; }); + $tdispatcher->addListener('foo', $listener2 = function () { }); $logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".'); $logger->expects($this->at(1))->method('debug')->with('Listener "closure" stopped propagation of the event "foo".'); diff --git a/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php b/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php index 6063c27ba4..6901329a5e 100644 --- a/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php +++ b/src/Symfony/Component/ExpressionLanguage/Tests/Node/NodeTest.php @@ -20,7 +20,7 @@ class NodeTest extends \PHPUnit_Framework_TestCase { $node = new Node(array(new ConstantNode('foo'))); - $this->assertEquals(<<assertEquals(<<<'EOF' Node( ConstantNode(value: 'foo') ) diff --git a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php index 579beed2ed..6e10550c06 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php @@ -77,7 +77,6 @@ class PathFilterIteratorTest extends IteratorTestCase array($inner, array('copy/A'), array(), array('abc.dat.copy', 'ab.dat.copy', 'a.dat.copy')), array($inner, array('copy/A/B'), array(), array('abc.dat.copy', 'ab.dat.copy')), array($inner, array('copy/A/B/C'), array(), array('abc.dat.copy')), - ); } } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php index 6a3124d352..4750f250d7 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php @@ -32,7 +32,7 @@ class SortableIteratorTest extends RealIteratorTestCase { if (!is_callable($mode)) { switch ($mode) { - case SortableIterator::SORT_BY_ACCESSED_TIME : + case SortableIterator::SORT_BY_ACCESSED_TIME: if ('\\' === DIRECTORY_SEPARATOR) { touch(self::toAbsolute('.git')); } else { @@ -41,12 +41,12 @@ class SortableIteratorTest extends RealIteratorTestCase sleep(1); file_get_contents(self::toAbsolute('.bar')); break; - case SortableIterator::SORT_BY_CHANGED_TIME : + case SortableIterator::SORT_BY_CHANGED_TIME: file_put_contents(self::toAbsolute('test.php'), 'foo'); sleep(1); file_put_contents(self::toAbsolute('test.py'), 'foo'); break; - case SortableIterator::SORT_BY_MODIFIED_TIME : + case SortableIterator::SORT_BY_MODIFIED_TIME: file_put_contents(self::toAbsolute('test.php'), 'foo'); sleep(1); file_put_contents(self::toAbsolute('test.py'), 'foo'); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index 2b4b255b0d..d00b8d4233 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -436,7 +436,6 @@ class FormTypeTest extends BaseTypeTest $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( function () {}, function ($value) { // reverseTransform - return 'foobar'; } )); @@ -462,7 +461,6 @@ class FormTypeTest extends BaseTypeTest $builder->get('referenceCopy')->addViewTransformer(new CallbackTransformer( function () {}, function ($value) use ($ref2) { // reverseTransform - return $ref2; } )); diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index ae174f045d..8774ad0468 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -641,10 +641,10 @@ class SimpleFormTest extends AbstractFormTest $form = $this->getBuilder() ->setEmptyData('foo') ->addViewTransformer(new FixedDataTransformer(array( - '' => '', - // direction is reversed! - 'bar' => 'foo', - ))) + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) ->getForm(); $form->submit(''); @@ -657,17 +657,17 @@ class SimpleFormTest extends AbstractFormTest $test = $this; $form = $this->getBuilder() ->setEmptyData(function ($form) use ($test) { - // the form instance is passed to the closure to allow use - // of form data when creating the empty value - $test->assertInstanceOf('Symfony\Component\Form\FormInterface', $form); + // the form instance is passed to the closure to allow use + // of form data when creating the empty value + $test->assertInstanceOf('Symfony\Component\Form\FormInterface', $form); - return 'foo'; - }) + return 'foo'; + }) ->addViewTransformer(new FixedDataTransformer(array( - '' => '', - // direction is reversed! - 'bar' => 'foo', - ))) + '' => '', + // direction is reversed! + 'bar' => 'foo', + ))) ->getForm(); $form->submit(''); diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 0c54c16b29..2fa72d9aac 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -1090,7 +1090,6 @@ class RequestTest extends \PHPUnit_Framework_TestCase array('put'), array('delete'), array('patch'), - ); } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index fde3bcde55..1a2c35ffb7 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -222,7 +222,7 @@ class IntlDateFormatterTest extends AbstractIntlDateFormatterTest private function notImplemented(array $dataSets) { return array_map(function ($row) { - return array($row[0], $row[1], 0); - }, $dataSets); + return array($row[0], $row[1], 0); + }, $dataSets); } } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php index 5742b0c70a..256ed2fc90 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php @@ -141,7 +141,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase public function testContext() { $array = array('person' => array('name' => 'George Abitbol')); - $expected = << @@ -255,7 +255,7 @@ XML; $serializer = new Serializer(array(new CustomNormalizer()), array('xml' => new XmlEncoder())); $this->encoder->setSerializer($serializer); - $expected = << normalizedFoonormalizedBar @@ -366,7 +366,7 @@ XML; public function testDecodeIgnoreWhiteSpace() { - $source = << diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php index 398a579b9f..e3780e55c0 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php @@ -343,8 +343,8 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bar) { - return 'baz'; - }, + return 'baz'; + }, ), 'baz', array('foo' => '', 'bar' => 'baz', 'baz' => true), @@ -353,8 +353,8 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bar) { - return; - }, + return; + }, ), 'baz', array('foo' => '', 'bar' => null, 'baz' => true), @@ -363,8 +363,8 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bar) { - return $bar->format('d-m-Y H:i:s'); - }, + return $bar->format('d-m-Y H:i:s'); + }, ), new \DateTime('2011-09-10 06:30:00'), array('foo' => '', 'bar' => '10-09-2011 06:30:00', 'baz' => true), @@ -373,13 +373,13 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bars) { - $foos = ''; - foreach ($bars as $bar) { - $foos .= $bar->getFoo(); - } + $foos = ''; + foreach ($bars as $bar) { + $foos .= $bar->getFoo(); + } - return $foos; - }, + return $foos; + }, ), array(new ObjectConstructorDummy('baz', '', false), new ObjectConstructorDummy('quux', '', false)), array('foo' => '', 'bar' => 'bazquux', 'baz' => true), @@ -388,8 +388,8 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase array( array( 'bar' => function ($bars) { - return count($bars); - }, + return count($bars); + }, ), array(new ObjectConstructorDummy('baz', '', false), new ObjectConstructorDummy('quux', '', false)), array('foo' => '', 'bar' => 2, 'baz' => true), diff --git a/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php b/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php index 126e9b7e8a..0fd5b35ae3 100644 --- a/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/IcuResFileDumper.php @@ -34,7 +34,7 @@ class IcuResFileDumper extends FileDumper foreach ($messages->all($domain) as $source => $target) { $indexes .= pack('v', strlen($data) + 28); - $data .= $source."\0"; + $data .= $source."\0"; } $data .= $this->writePadding($data); diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 1369e9783b..48a801d375 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -376,9 +376,9 @@ EOF $fallbackSuffix = ucfirst(preg_replace($replacementPattern, '_', $fallback)); $currentSuffix = ucfirst(preg_replace($replacementPattern, '_', $current)); - $fallbackContent .= sprintf(<<addFallbackCatalogue(\$catalogue%s); + $fallbackContent .= sprintf(<<<'EOF' +$catalogue%s = new MessageCatalogue('%s', %s); +$catalogue%s->addFallbackCatalogue($catalogue%s); EOF , diff --git a/src/Symfony/Component/Validator/ConstraintValidator.php b/src/Symfony/Component/Validator/ConstraintValidator.php index c0db7e29ef..b156c6dde9 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -119,7 +119,7 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface * (i.e. "false" for false, "1" for 1 etc.). Strings are always wrapped * in double quotes ("). Objects, arrays and resources are formatted as * "object", "array" and "resource". If the $format bitmask contains - * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted + * the PRETTY_DATE bit, then {@link \DateTime} objects will be formatted * as RFC-3339 dates ("Y-m-d H:i:s"). * * Be careful when passing message parameters to a constraint violation diff --git a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php index aaf52dc561..6ca8488a5c 100644 --- a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php @@ -144,14 +144,14 @@ class IsbnValidator extends ConstraintValidator // If we test the length before the loop, we get an ERROR_TOO_SHORT // when actually an ERROR_INVALID_CHARACTERS is wanted, e.g. for // "0-45122_5244" (typo) - if (!isset($isbn{$i})) { + if (!isset($isbn[$i])) { return Isbn::TOO_SHORT_ERROR; } - if ('X' === $isbn{$i}) { + if ('X' === $isbn[$i]) { $digit = 10; - } elseif (ctype_digit($isbn{$i})) { - $digit = $isbn{$i}; + } elseif (ctype_digit($isbn[$i])) { + $digit = $isbn[$i]; } else { return Isbn::INVALID_CHARACTERS_ERROR; } @@ -159,7 +159,7 @@ class IsbnValidator extends ConstraintValidator $checkSum += $digit * (10 - $i); } - if (isset($isbn{$i})) { + if (isset($isbn[$i])) { return Isbn::TOO_LONG_ERROR; } @@ -190,11 +190,11 @@ class IsbnValidator extends ConstraintValidator $checkSum = 0; for ($i = 0; $i < 13; $i += 2) { - $checkSum += $isbn{$i}; + $checkSum += $isbn[$i]; } for ($i = 1; $i < 12; $i += 2) { - $checkSum += $isbn{$i} + $checkSum += $isbn[$i] * 3; } diff --git a/src/Symfony/Component/Validator/Constraints/IssnValidator.php b/src/Symfony/Component/Validator/Constraints/IssnValidator.php index 000af74f28..1405acfc70 100644 --- a/src/Symfony/Component/Validator/Constraints/IssnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IssnValidator.php @@ -48,7 +48,7 @@ class IssnValidator extends ConstraintValidator // 1234-567X // ^ - if (isset($canonical{4}) && '-' === $canonical{4}) { + if (isset($canonical[4]) && '-' === $canonical[4]) { // remove hyphen $canonical = substr($canonical, 0, 4).substr($canonical, 5); } elseif ($constraint->requireHyphen) { @@ -121,7 +121,7 @@ class IssnValidator extends ConstraintValidator // 1234567X // ^ digit, x or X - if (!ctype_digit($canonical{7}) && 'x' !== $canonical{7} && 'X' !== $canonical{7}) { + if (!ctype_digit($canonical[7]) && 'x' !== $canonical[7] && 'X' !== $canonical[7]) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -139,7 +139,7 @@ class IssnValidator extends ConstraintValidator // 1234567X // ^ case-sensitive? - if ($constraint->caseSensitive && 'x' === $canonical{7}) { + if ($constraint->caseSensitive && 'x' === $canonical[7]) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -156,14 +156,14 @@ class IssnValidator extends ConstraintValidator } // Calculate a checksum. "X" equals 10. - $checkSum = 'X' === $canonical{7} - || 'x' === $canonical{7} + $checkSum = 'X' === $canonical[7] + || 'x' === $canonical[7] ? 10 - : $canonical{7}; + : $canonical[7]; for ($i = 0; $i < 7; ++$i) { // Multiply the first digit by 8, the second by 7, etc. - $checkSum += (8 - $i) * $canonical{$i}; + $checkSum += (8 - $i) * $canonical[$i]; } if (0 !== $checkSum % 11) { diff --git a/src/Symfony/Component/Validator/Constraints/LuhnValidator.php b/src/Symfony/Component/Validator/Constraints/LuhnValidator.php index 31d4497d6e..e971ab153d 100644 --- a/src/Symfony/Component/Validator/Constraints/LuhnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LuhnValidator.php @@ -81,7 +81,7 @@ class LuhnValidator extends ConstraintValidator // ^ ^ ^ ^ ^ ^ // = 7 + 9 + 7 + 9 + 7 + 3 for ($i = $length - 1; $i >= 0; $i -= 2) { - $checkSum += $value{$i}; + $checkSum += $value[$i]; } // Starting with the second last digit and walking left, double every @@ -91,7 +91,7 @@ class LuhnValidator extends ConstraintValidator // ^ ^ ^ ^ ^ // = 1+8 + 4 + 6 + 1+6 + 2 for ($i = $length - 2; $i >= 0; $i -= 2) { - $checkSum += array_sum(str_split($value{$i} * 2)); + $checkSum += array_sum(str_split($value[$i] * 2)); } if (0 === $checkSum || 0 !== $checkSum % 10) { diff --git a/src/Symfony/Component/Validator/Constraints/UuidValidator.php b/src/Symfony/Component/Validator/Constraints/UuidValidator.php index 02ec0b23f5..d025a560d2 100644 --- a/src/Symfony/Component/Validator/Constraints/UuidValidator.php +++ b/src/Symfony/Component/Validator/Constraints/UuidValidator.php @@ -118,7 +118,7 @@ class UuidValidator extends ConstraintValidator for ($i = 0; $i < $l; ++$i) { // Check length - if (!isset($trimmed{$i})) { + if (!isset($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -137,7 +137,7 @@ class UuidValidator extends ConstraintValidator // Hyphens must occur every fifth position // xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx // ^ ^ ^ ^ ^ ^ ^ - if ('-' === $trimmed{$i}) { + if ('-' === $trimmed[$i]) { if ($i !== $h) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) @@ -166,7 +166,7 @@ class UuidValidator extends ConstraintValidator } // Check characters - if (!ctype_xdigit($trimmed{$i})) { + if (!ctype_xdigit($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -184,7 +184,7 @@ class UuidValidator extends ConstraintValidator } // Check length again - if (isset($trimmed{$i})) { + if (isset($trimmed[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -213,7 +213,7 @@ class UuidValidator extends ConstraintValidator for ($i = 0; $i < self::STRICT_LENGTH; ++$i) { // Check length - if (!isset($value{$i})) { + if (!isset($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -232,7 +232,7 @@ class UuidValidator extends ConstraintValidator // Check hyphen placement // xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // ^ ^ ^ ^ - if ('-' === $value{$i}) { + if ('-' === $value[$i]) { if ($i !== $h) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) @@ -259,7 +259,7 @@ class UuidValidator extends ConstraintValidator } // Check characters - if (!ctype_xdigit($value{$i})) { + if (!ctype_xdigit($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -294,7 +294,7 @@ class UuidValidator extends ConstraintValidator } // Check length again - if (isset($value{$i})) { + if (isset($value[$i])) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -309,7 +309,7 @@ class UuidValidator extends ConstraintValidator } // Check version - if (!in_array($value{self::STRICT_VERSION_POSITION}, $constraint->versions)) { + if (!in_array($value[self::STRICT_VERSION_POSITION], $constraint->versions)) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) @@ -327,7 +327,7 @@ class UuidValidator extends ConstraintValidator // 0b10xx // & 0b1100 (12) // = 0b1000 (8) - if ((hexdec($value{self::STRICT_VARIANT_POSITION}) & 12) !== 8) { + if ((hexdec($value[self::STRICT_VARIANT_POSITION]) & 12) !== 8) { if ($this->context instanceof ExecutionContextInterface) { $this->context->buildViolation($constraint->message) ->setParameter('{{ value }}', $this->formatValue($value)) diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php index 5ad8276563..6bd7735f0d 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php @@ -185,7 +185,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -201,7 +200,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -217,7 +215,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -235,7 +232,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -255,7 +251,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ @@ -273,7 +268,6 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } - // BC with Symfony < 2.4 /** * @group legacy */ diff --git a/src/Symfony/Component/Validator/Util/PropertyPath.php b/src/Symfony/Component/Validator/Util/PropertyPath.php index 52546c5ea9..4108a02c24 100644 --- a/src/Symfony/Component/Validator/Util/PropertyPath.php +++ b/src/Symfony/Component/Validator/Util/PropertyPath.php @@ -37,7 +37,7 @@ class PropertyPath public static function append($basePath, $subPath) { if ('' !== (string) $subPath) { - if ('[' === $subPath{0}) { + if ('[' === $subPath[0]) { return $basePath.$subPath; } diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index 4835c95509..db5d880969 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -314,6 +314,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface return array($groups); } + /** * Validates an object against the constraints defined for its class. * diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index a529cd4dfb..59ba119e42 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -59,7 +59,7 @@ class CliDumper extends AbstractDumper parent::__construct($output, $charset); if ('\\' === DIRECTORY_SEPARATOR && 'ON' !== @getenv('ConEmuANSI') && 'xterm' !== @getenv('TERM')) { - // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI + // Use only the base 16 xterm colors when using ANSICON or standard Windows 10 CLI $this->setStyles(array( 'default' => '31', 'num' => '1;34', diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index bd69f2eddf..4f572caea3 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -441,7 +441,7 @@ EOHTML; if (0xF0 <= $m[$i]) { $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; } else { $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; } diff --git a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php index cfbfa82684..519e6a126b 100644 --- a/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/CliDumperTest.php @@ -120,7 +120,7 @@ EOTXT $var = xml_parser_create(); $this->assertDumpMatchesFormat( - <<assertDumpMatchesFormat( - << {} "1" => &1 null @@ -161,7 +161,7 @@ EOTXT $var->{1} = 2; $this->assertDumpMatchesFormat( - <<getSpecialVars(); $this->assertDumpEquals( - << array:1 [ 0 => &1 array:1 [ @@ -342,7 +342,7 @@ EOTXT $dumper->dump($data); $this->assertSame( - << array:1 [ "GLOBALS" => &1 array:1 [ @@ -384,7 +384,7 @@ EOTXT }); $this->assertSame( - << array:1 [ 0 => array:1 [ diff --git a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php index 30495f7c40..e6fd489448 100644 --- a/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php +++ b/src/Symfony/Component/VarDumper/Tests/HtmlDumperTest.php @@ -135,7 +135,7 @@ EOTXT $out = stream_get_contents($out, -1, 0); $this->assertStringMatchesFormat( - <<b"Словарь" diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 1b6193a692..42b764e03e 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -444,7 +444,7 @@ EOF; public function testObjectForMapEnabledWithMapping() { - $yaml = << @@ -1011,7 +1011,7 @@ EOT; public function testBlankLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1023,7 +1023,7 @@ EOT; $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • may be a good example
EOT @@ -1035,7 +1035,7 @@ EOT public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() { - $yaml = <<

A heading

@@ -1047,7 +1047,7 @@ EOT; $this->assertSame( array( - 'test' => << <<<'EOT'

A heading

  • a list
  • @@ -1080,7 +1080,7 @@ EOT return array( array( 4, - <<