diff --git a/composer.json b/composer.json index 3e893c515c..0a5c409389 100644 --- a/composer.json +++ b/composer.json @@ -52,6 +52,7 @@ "symfony/security": "2.99.99", "symfony/security-core": "self.version", "symfony/security-csrf": "self.version", + "symfony/security-guard": "self.version", "symfony/security-http": "self.version", "symfony/security-bundle": "self.version", "symfony/serializer": "self.version", diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php index d724f680d8..11bffb9c12 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPassTest.php @@ -2,12 +2,12 @@ /* * This file is part of the Symfony package. -* -* (c) Fabien Potencier -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass; diff --git a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php index e37f1476ae..760c0fada0 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php @@ -2,12 +2,12 @@ /* * This file is part of the Symfony package. -* -* (c) Fabien Potencier -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection; diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index 36661f3637..09926bd680 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -133,7 +133,7 @@ class DeprecationErrorHandler private static function hasColorSupport() { if ('\\' === DIRECTORY_SEPARATOR) { - return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); + return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM'); } return defined('STDOUT') && function_exists('posix_isatty') && @posix_isatty(STDOUT); diff --git a/src/Symfony/Bridge/PhpUnit/bootstrap.php b/src/Symfony/Bridge/PhpUnit/bootstrap.php index 75a4b68ad3..c05d0b6db9 100644 --- a/src/Symfony/Bridge/PhpUnit/bootstrap.php +++ b/src/Symfony/Bridge/PhpUnit/bootstrap.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Doctrine\Common\Annotations\AnnotationRegistry; use Symfony\Bridge\PhpUnit\DeprecationErrorHandler; diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index a788a3df89..705e7e00bf 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -80,7 +80,7 @@ {% if datetime is not defined or false == datetime -%}
{%- endif -%} - {{- form_widget(form.hour) }}:{{ form_widget(form.minute) }}{% if with_seconds %}:{{ form_widget(form.second) }}{% endif %} + {{- form_widget(form.hour) }}{% if with_minutes %}:{{ form_widget(form.minute) }}{% endif %}{% if with_seconds %}:{{ form_widget(form.second) }}{% endif %} {% if datetime is not defined or false == datetime -%}
{%- endif -%} diff --git a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php index 07f81f5878..2b756a2997 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php +++ b/src/Symfony/Bundle/FrameworkBundle/CacheWarmer/TemplateFinder.php @@ -97,8 +97,12 @@ class TemplateFinder implements TemplateFinderInterface */ private function findTemplatesInBundle(BundleInterface $bundle) { - $templates = $this->findTemplatesInFolder($bundle->getPath().'/Resources/views'); $name = $bundle->getName(); + $templates = array_merge( + $this->findTemplatesInFolder($bundle->getPath().'/Resources/views'), + $this->findTemplatesInFolder($this->rootDir.'/'.$name.'/views') + ); + $templates = array_unique($templates); foreach ($templates as $i => $template) { $templates[$i] = $template->set('bundle', $name); diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php index 80f4e4ebb8..042f93b186 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/YamlLintCommand.php @@ -100,9 +100,9 @@ EOF private function validate($content, $file = null) { - $this->parser = new Parser(); + $parser = new Parser(); try { - $this->parser->parse($content); + $parser->parse($content); } catch (ParseException $e) { return array('file' => $file, 'valid' => false, 'message' => $e->getMessage()); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php index 59a7d1d920..a417cdae3d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php @@ -46,10 +46,11 @@ class TemplateFinderTest extends TestCase $finder->findAllTemplates() ); - $this->assertCount(6, $templates, '->findAllTemplates() find all templates in the bundles and global folders'); + $this->assertCount(7, $templates, '->findAllTemplates() find all templates in the bundles and global folders'); $this->assertContains('BaseBundle::base.format.engine', $templates); $this->assertContains('BaseBundle::this.is.a.template.format.engine', $templates); $this->assertContains('BaseBundle:controller:base.format.engine', $templates); + $this->assertContains('BaseBundle:controller:custom.format.engine', $templates); $this->assertContains('::this.is.a.template.format.engine', $templates); $this->assertContains('::resource.format.engine', $templates); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php index 0cfc92241b..9830897914 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Bundle\FrameworkBundle\Tests\Command\CacheClearCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php index da835dfd4d..8a61d96d36 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/Fixture/TestAppKernel.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Bundle\FrameworkBundle\Tests\Command\CacheClearCommand\Fixture; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/base.format.engine b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/base.format.engine new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/controller/custom.format.engine b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Resources/BaseBundle/views/controller/custom.format.engine new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php index 351cf79d43..a73987bcc9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/ConfigDump/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php index 351cf79d43..a73987bcc9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php index 351cf79d43..a73987bcc9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Profiler/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php index 351cf79d43..a73987bcc9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Session/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\TestBundle; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index aa46d47df5..ba8a987d66 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -357,7 +357,6 @@ class MainConfiguration implements ConfigurationInterface ), 'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')), )) - ->disallowNewKeysInSubsequentConfigs() ->isRequired() ->requiresAtLeastOneElement() ->useAttributeAsKey('name') diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php index 0d58c39b05..2375267777 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php @@ -94,7 +94,7 @@ class GuardAuthenticationFactory implements SecurityFactoryInterface // explode if they've configured the entry_point, but there is already one if ($config['entry_point']) { throw new \LogicException(sprintf( - 'The guard authentication provider cannot use the "%s" entry_point because another entry point is already configured by another provider! Either remove the other provider or move the entry_point configuration as a root key under your firewall', + 'The guard authentication provider cannot use the "%s" entry_point because another entry point is already configured by another provider! Either remove the other provider or move the entry_point configuration as a root key under your firewall (i.e. at the same level as "guard").', $config['entry_point'] )); } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php index cf2f561503..d8435e86c5 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Bundle\SecurityBundle\Tests\DataCollector; use Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector; diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php index c790058fac..9a8b5e2e97 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SetAclCommandTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Bundle\SecurityBundle\Tests\Functional; /* diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php index f93fbb1c62..51337913d5 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/Acl/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + return array( new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php index cee883f9cb..c16ab12f65 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + return array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php index c6fd207dd1..412e1c5d09 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + return array( new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php index c57028f931..2e9243712c 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/PasswordEncode/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + return array( new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php index e4bbc08f73..d53ff3e7eb 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\FormLoginBundle; use Symfony\Bundle\TwigBundle\TwigBundle; use Symfony\Bundle\SecurityBundle\SecurityBundle; diff --git a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig index f196e91b58..d733f1d02f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig +++ b/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig @@ -390,6 +390,13 @@ e.preventDefault(); var toggle = e.target || e.srcElement; + + /* needed because when the toggle contains HTML contents, user can click */ + /* on any of those elements instead of their parent '.sf-toggle' element */ + while (!Sfjs.hasClass(toggle, 'sf-toggle')) { + toggle = toggle.parentNode; + } + var element = document.querySelector(toggle.getAttribute('data-toggle-selector')); Sfjs.toggleClass(element, 'sf-toggle-hidden'); diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 1d13ffe881..e63841d260 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -89,7 +89,7 @@ class StreamOutput extends Output * * Colorization is disabled if not supported by the stream: * - * - Windows without Ansicon and ConEmu + * - Windows without Ansicon, ConEmu or Mintty * - non tty consoles * * @return bool true if the stream supports colorization, false otherwise @@ -97,7 +97,7 @@ class StreamOutput extends Output protected function hasColorSupport() { if (DIRECTORY_SEPARATOR === '\\') { - return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI'); + return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM'); } return function_exists('posix_isatty') && @posix_isatty($this->stream); diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php index e37853e40c..21fdca0962 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php @@ -16,6 +16,8 @@ use Symfony\Component\Console\Helper\Helper; use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Tests; +require_once __DIR__.'/../ClockMock.php'; + class ProgressBarTest extends \PHPUnit_Framework_TestCase { protected function setUp() diff --git a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php index 2df4f40e4a..7aa6a3f54c 100644 --- a/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php +++ b/src/Symfony/Component/Console/Tests/Style/SymfonyStyleTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Console\Tests\Style; use PHPUnit_Framework_TestCase; diff --git a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php index 4098ac1c3a..df0f55a830 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/CheckReferenceValidityPass.php @@ -46,7 +46,6 @@ class CheckReferenceValidityPass implements CompilerPassInterface } $this->currentId = $id; - $this->currentDefinition = $definition; $this->validateReferences($definition->getArguments()); $this->validateReferences($definition->getMethodCalls()); diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ExtensionCompilerPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ExtensionCompilerPass.php index a9b418d497..b06b497029 100644 --- a/src/Symfony/Component/DependencyInjection/Compiler/ExtensionCompilerPass.php +++ b/src/Symfony/Component/DependencyInjection/Compiler/ExtensionCompilerPass.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php index 952f7a0bd8..2ffa767805 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\DependencyInjection\Tests\Compiler; use Symfony\Component\DependencyInjection\Alias; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ExtensionCompilerPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ExtensionCompilerPassTest.php index ef690da163..637ed7b67b 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ExtensionCompilerPassTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ExtensionCompilerPassTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\DependencyInjection\Tests\Compiler; use Symfony\Component\DependencyInjection\Compiler\ExtensionCompilerPass; diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index aa39d7ccfd..30b8257934 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -325,6 +325,17 @@ class Crawler extends \SplObjectStorage } } + // Serializing and unserializing a crawler creates DOM objects in a corrupted state. DOM elements are not properly serializable. + public function unserialize($serialized) + { + throw new \BadMethodCallException('A Crawler cannot be serialized.'); + } + + public function serialize() + { + throw new \BadMethodCallException('A Crawler cannot be serialized.'); + } + /** * Returns a node given its position in the node list. * diff --git a/src/Symfony/Component/ExpressionLanguage/Resources/bin/generate_operator_regex.php b/src/Symfony/Component/ExpressionLanguage/Resources/bin/generate_operator_regex.php index 02ed385106..74a100890d 100644 --- a/src/Symfony/Component/ExpressionLanguage/Resources/bin/generate_operator_regex.php +++ b/src/Symfony/Component/ExpressionLanguage/Resources/bin/generate_operator_regex.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + $operators = array('not', '!', 'or', '||', '&&', 'and', '|', '^', '&', '==', '===', '!=', '!==', '<', '>', '>=', '<=', 'not in', 'in', '..', '+', '-', '~', '*', '/', '%', 'matches', '**'); $operators = array_combine($operators, array_map('strlen', $operators)); arsort($operators); diff --git a/src/Symfony/Component/ExpressionLanguage/Tests/ExpressionTest.php b/src/Symfony/Component/ExpressionLanguage/Tests/ExpressionTest.php index be87321fd3..f28c6a9423 100644 --- a/src/Symfony/Component/ExpressionLanguage/Tests/ExpressionTest.php +++ b/src/Symfony/Component/ExpressionLanguage/Tests/ExpressionTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\ExpressionLanguage\Tests; use Symfony\Component\ExpressionLanguage\Expression; diff --git a/src/Symfony/Component/ExpressionLanguage/Tests/ParsedExpressionTest.php b/src/Symfony/Component/ExpressionLanguage/Tests/ParsedExpressionTest.php index c91b9ef666..18bde0210e 100644 --- a/src/Symfony/Component/ExpressionLanguage/Tests/ParsedExpressionTest.php +++ b/src/Symfony/Component/ExpressionLanguage/Tests/ParsedExpressionTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\ExpressionLanguage\Tests; use Symfony\Component\ExpressionLanguage\Node\ConstantNode; diff --git a/src/Symfony/Component/Filesystem/Tests/LockHandlerTest.php b/src/Symfony/Component/Filesystem/Tests/LockHandlerTest.php index 9ab5537451..c7509f61e6 100644 --- a/src/Symfony/Component/Filesystem/Tests/LockHandlerTest.php +++ b/src/Symfony/Component/Filesystem/Tests/LockHandlerTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Filesystem\Tests; use Symfony\Component\Filesystem\LockHandler; diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php index 436d8af560..b59d0d6f27 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RecursiveDirectoryIteratorTest.php @@ -2,12 +2,12 @@ /* * This file is part of the Symfony package. -* -* (c) Fabien Potencier -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Component\Finder\Tests\Iterator; @@ -16,42 +16,36 @@ use Symfony\Component\Finder\Iterator\RecursiveDirectoryIterator; class RecursiveDirectoryIteratorTest extends IteratorTestCase { /** - * @dataProvider getPaths - * - * @param string $path - * @param bool $seekable - * @param array $contains - * @param string $message + * @group network */ - public function testRewind($path, $seekable, $contains, $message = null) + public function testRewindOnFtp() { try { - $i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { - $this->markTestSkipped(sprintf('Unsupported stream "%s".', $path)); + $this->markTestSkipped('Unsupported stream "ftp".'); } $i->rewind(); - $this->assertTrue(true, $message); + $this->assertTrue(true); } /** - * @dataProvider getPaths - * - * @param string $path - * @param bool $seekable - * @param array $contains - * @param string $message + * @group network */ - public function testSeek($path, $seekable, $contains, $message = null) + public function testSeekOnFtp() { try { - $i = new RecursiveDirectoryIterator($path, \RecursiveDirectoryIterator::SKIP_DOTS); + $i = new RecursiveDirectoryIterator('ftp://ftp.mozilla.org/', \RecursiveDirectoryIterator::SKIP_DOTS); } catch (\UnexpectedValueException $e) { - $this->markTestSkipped(sprintf('Unsupported stream "%s".', $path)); + $this->markTestSkipped('Unsupported stream "ftp".'); } + $contains = array( + 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README', + 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub', + ); $actual = array(); $i->seek(0); @@ -62,18 +56,4 @@ class RecursiveDirectoryIteratorTest extends IteratorTestCase $this->assertEquals($contains, $actual); } - - public function getPaths() - { - $data = array(); - - // ftp - $contains = array( - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'README', - 'ftp://ftp.mozilla.org'.DIRECTORY_SEPARATOR.'pub', - ); - $data[] = array('ftp://ftp.mozilla.org/', false, $contains); - - return $data; - } } diff --git a/src/Symfony/Component/Form/CHANGELOG.md b/src/Symfony/Component/Form/CHANGELOG.md index 4476eba513..a934043471 100644 --- a/src/Symfony/Component/Form/CHANGELOG.md +++ b/src/Symfony/Component/Form/CHANGELOG.md @@ -14,6 +14,7 @@ CHANGELOG 2.8.0 ----- + * added option "choice_translation_domain" to DateType, TimeType and DateTimeType. * deprecated option "read_only" in favor of "attr['readonly']" * added the html5 "range" FormType * deprecated the "cascade_validation" option in favor of setting "constraints" diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php index cddeac9b4d..ef4d1ad260 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php @@ -116,6 +116,7 @@ class DateTimeType extends AbstractType 'days', 'empty_value', 'placeholder', + 'choice_translation_domain', 'required', 'translation_domain', 'html5', @@ -131,6 +132,7 @@ class DateTimeType extends AbstractType 'with_seconds', 'empty_value', 'placeholder', + 'choice_translation_domain', 'required', 'translation_domain', 'html5', @@ -245,6 +247,7 @@ class DateTimeType extends AbstractType $resolver->setDefined(array( 'empty_value', // deprecated 'placeholder', + 'choice_translation_domain', 'years', 'months', 'days', diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index 2a620a1220..f6d5a52346 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -94,10 +94,13 @@ class DateType extends AbstractType // Only pass a subset of the options to children $yearOptions['choices'] = $this->formatTimestamps($formatter, '/y+/', $this->listYears($options['years'])); $yearOptions['placeholder'] = $options['placeholder']['year']; + $yearOptions['choice_translation_domain'] = $options['choice_translation_domain']['year']; $monthOptions['choices'] = $this->formatTimestamps($formatter, '/[M|L]+/', $this->listMonths($options['months'])); $monthOptions['placeholder'] = $options['placeholder']['month']; + $monthOptions['choice_translation_domain'] = $options['choice_translation_domain']['month']; $dayOptions['choices'] = $this->formatTimestamps($formatter, '/d+/', $this->listDays($options['days'])); $dayOptions['placeholder'] = $options['placeholder']['day']; + $dayOptions['choice_translation_domain'] = $options['choice_translation_domain']['day']; } // Append generic carry-along options @@ -205,6 +208,23 @@ class DateType extends AbstractType ); }; + $choiceTranslationDomainNormalizer = function (Options $options, $choiceTranslationDomain) { + if (is_array($choiceTranslationDomain)) { + $default = false; + + return array_replace( + array('year' => $default, 'month' => $default, 'day' => $default), + $choiceTranslationDomain + ); + }; + + return array( + 'year' => $choiceTranslationDomain, + 'month' => $choiceTranslationDomain, + 'day' => $choiceTranslationDomain, + ); + }; + $format = function (Options $options) { return $options['widget'] === 'single_text' ? DateType::HTML5_FORMAT : DateType::DEFAULT_FORMAT; }; @@ -231,10 +251,12 @@ class DateType extends AbstractType // this option. 'data_class' => null, 'compound' => $compound, + 'choice_translation_domain' => false, )); $resolver->setNormalizer('empty_value', $placeholderNormalizer); $resolver->setNormalizer('placeholder', $placeholderNormalizer); + $resolver->setNormalizer('choice_translation_domain', $choiceTranslationDomainNormalizer); $resolver->setAllowedValues('input', array( 'datetime', diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index d4803d03e7..516403f907 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -69,6 +69,7 @@ class TimeType extends AbstractType // Only pass a subset of the options to children $hourOptions['choices'] = $hours; $hourOptions['placeholder'] = $options['placeholder']['hour']; + $hourOptions['choice_translation_domain'] = $options['choice_translation_domain']['hour']; if ($options['with_minutes']) { foreach ($options['minutes'] as $minute) { @@ -77,6 +78,7 @@ class TimeType extends AbstractType $minuteOptions['choices'] = $minutes; $minuteOptions['placeholder'] = $options['placeholder']['minute']; + $minuteOptions['choice_translation_domain'] = $options['choice_translation_domain']['minute']; } if ($options['with_seconds']) { @@ -88,6 +90,7 @@ class TimeType extends AbstractType $secondOptions['choices'] = $seconds; $secondOptions['placeholder'] = $options['placeholder']['second']; + $secondOptions['choice_translation_domain'] = $options['choice_translation_domain']['second']; } // Append generic carry-along options @@ -194,6 +197,23 @@ class TimeType extends AbstractType ); }; + $choiceTranslationDomainNormalizer = function (Options $options, $choiceTranslationDomain) { + if (is_array($choiceTranslationDomain)) { + $default = false; + + return array_replace( + array('hour' => $default, 'minute' => $default, 'second' => $default), + $choiceTranslationDomain + ); + }; + + return array( + 'hour' => $choiceTranslationDomain, + 'minute' => $choiceTranslationDomain, + 'second' => $choiceTranslationDomain, + ); + }; + $resolver->setDefaults(array( 'hours' => range(0, 23), 'minutes' => range(0, 59), @@ -217,10 +237,12 @@ class TimeType extends AbstractType // this option. 'data_class' => null, 'compound' => $compound, + 'choice_translation_domain' => false, )); $resolver->setNormalizer('empty_value', $placeholderNormalizer); $resolver->setNormalizer('placeholder', $placeholderNormalizer); + $resolver->setNormalizer('choice_translation_domain', $choiceTranslationDomainNormalizer); $resolver->setAllowedValues('input', array( 'datetime', diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index bbe1914dec..d217cf0193 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -854,6 +854,10 @@ class FormConfigBuilder implements FormConfigBuilderInterface */ public function setAutoInitialize($initialize) { + if ($this->locked) { + throw new BadMethodCallException('FormConfigBuilder methods cannot be accessed anymore once the builder is turned into a FormConfigInterface instance.'); + } + $this->autoInitialize = (bool) $initialize; return $this; diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php index bafe5c098f..33779260ae 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ArrayToPartsTransformerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BaseDateTimeTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BaseDateTimeTransformerTest.php index 8f2d16bb1b..7eb716b6d3 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BaseDateTimeTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/BaseDateTimeTransformerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php index 6dc9785c24..eb3cf9704b 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php index cd09561c41..53ce7027f1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php @@ -484,4 +484,57 @@ class DateTimeTypeTest extends TestCase $this->assertSame(array(), iterator_to_array($form['time']->getErrors())); $this->assertSame(array($error), iterator_to_array($form->getErrors())); } + + public function testPassDefaultChoiceTranslationDomain() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateTimeType', null, array( + 'with_seconds' => true, + )); + + $view = $form->createView(); + + $this->assertFalse($view['date']['year']->vars['choice_translation_domain']); + $this->assertFalse($view['date']['month']->vars['choice_translation_domain']); + $this->assertFalse($view['date']['day']->vars['choice_translation_domain']); + $this->assertFalse($view['time']['hour']->vars['choice_translation_domain']); + $this->assertFalse($view['time']['minute']->vars['choice_translation_domain']); + $this->assertFalse($view['time']['second']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsString() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateTimeType', null, array( + 'choice_translation_domain' => 'messages', + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('messages', $view['date']['year']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['date']['month']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['date']['day']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['time']['hour']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['time']['minute']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['time']['second']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsArray() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateTimeType', null, array( + 'choice_translation_domain' => array( + 'year' => 'foo', + 'month' => 'test', + 'hour' => 'foo', + 'second' => 'test', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('foo', $view['date']['year']->vars['choice_translation_domain']); + $this->assertSame('test', $view['date']['month']->vars['choice_translation_domain']); + $this->assertFalse($view['date']['day']->vars['choice_translation_domain']); + $this->assertSame('foo', $view['time']['hour']->vars['choice_translation_domain']); + $this->assertFalse($view['time']['minute']->vars['choice_translation_domain']); + $this->assertSame('test', $view['time']['second']->vars['choice_translation_domain']); + } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php index a3b1bb4556..e04ea568b5 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php @@ -922,4 +922,41 @@ class DateTypeTest extends TestCase $this->assertEquals($listChoices, $view['year']->vars['choices']); } + + public function testPassDefaultChoiceTranslationDomain() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateType'); + + $view = $form->createView(); + $this->assertFalse($view['year']->vars['choice_translation_domain']); + $this->assertFalse($view['month']->vars['choice_translation_domain']); + $this->assertFalse($view['day']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsString() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateType', null, array( + 'choice_translation_domain' => 'messages', + )); + + $view = $form->createView(); + $this->assertSame('messages', $view['year']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['month']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['day']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsArray() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\DateType', null, array( + 'choice_translation_domain' => array( + 'year' => 'foo', + 'day' => 'test', + ), + )); + + $view = $form->createView(); + $this->assertSame('foo', $view['year']->vars['choice_translation_domain']); + $this->assertFalse($view['month']->vars['choice_translation_domain']); + $this->assertSame('test', $view['day']->vars['choice_translation_domain']); + } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php index 6b76da17e5..777989d87e 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php @@ -707,4 +707,42 @@ class TimeTypeTest extends TestCase 'seconds' => 'bad value', )); } + + public function testPassDefaultChoiceTranslationDomain() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\TimeType'); + + $view = $form->createView(); + $this->assertFalse($view['hour']->vars['choice_translation_domain']); + $this->assertFalse($view['minute']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsString() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\TimeType', null, array( + 'choice_translation_domain' => 'messages', + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('messages', $view['hour']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['minute']->vars['choice_translation_domain']); + $this->assertSame('messages', $view['second']->vars['choice_translation_domain']); + } + + public function testPassChoiceTranslationDomainAsArray() + { + $form = $this->factory->create('Symfony\Component\Form\Extension\Core\Type\TimeType', null, array( + 'choice_translation_domain' => array( + 'hour' => 'foo', + 'second' => 'test', + ), + 'with_seconds' => true, + )); + + $view = $form->createView(); + $this->assertSame('foo', $view['hour']->vars['choice_translation_domain']); + $this->assertFalse($view['minute']->vars['choice_translation_domain']); + $this->assertSame('test', $view['second']->vars['choice_translation_domain']); + } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php index 7c816d7f48..50c071ef53 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php index f197b19857..8ace4d3c3b 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Type/TypeTestCase.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php index d85cd863c0..6a1484baa8 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php @@ -1,13 +1,13 @@ -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Component\Form\Tests\Extension\Validator; diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php index 0e5a24bf67..5991520b14 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php @@ -1,13 +1,13 @@ -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Component\Form\Tests\Extension\Validator; diff --git a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php index 7836852100..311ce9d3ef 100644 --- a/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php +++ b/src/Symfony/Component/Form/Tests/Util/StringUtilTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Form\Tests\Util; use Symfony\Component\Form\Util\StringUtil; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php index acda437270..c9a90cb216 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php @@ -64,7 +64,7 @@ class NativeSessionStorage implements SessionStorageInterface * ("auto_start", is not supported as it tells PHP to start a session before * PHP starts to execute user-land code. Setting during runtime has no effect). * - * cache_limiter, "nocache" (use "0" to prevent headers from being sent entirely). + * cache_limiter, "" (use "0" to prevent headers from being sent entirely). * cookie_domain, "" * cookie_httponly, "" * cookie_lifetime, "0" diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php index 53730dcd7c..ab52678c86 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DumpDataCollector.php @@ -34,6 +34,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface private $clonesIndex = 0; private $rootRefs; private $charset; + private $requestStack; private $dumper; private $dumperIsInjected; diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php index dede8e0739..c12d241fec 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -154,7 +154,6 @@ class Esi implements SurrogateInterface */ public function process(Request $request, Response $response) { - $this->request = $request; $type = $response->headers->get('Content-Type'); if (empty($type)) { $type = 'text/html'; diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Ssi.php b/src/Symfony/Component/HttpKernel/HttpCache/Ssi.php index 7bb54cff62..43311b6dc8 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Ssi.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Ssi.php @@ -113,7 +113,6 @@ class Ssi implements SurrogateInterface */ public function process(Request $request, Response $response) { - $this->request = $request; $type = $response->headers->get('Content-Type'); if (empty($type)) { $type = 'text/html'; diff --git a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php index e12c8d05e8..57568d3936 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php @@ -3,7 +3,7 @@ /* * This file is part of the Symfony package. * - * (c) Fabien Potencier + * (c) Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php index 766e2b1d49..1fcd210751 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTestCase.php @@ -28,6 +28,7 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase protected $responses; protected $catch; protected $esi; + protected $store; protected function setUp() { diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php index 773e221482..5b5209e9a6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php @@ -23,7 +23,7 @@ class TestMultipleHttpKernel extends HttpKernel implements ControllerResolverInt protected $bodies = array(); protected $statuses = array(); protected $headers = array(); - protected $call = false; + protected $called = false; protected $backendRequest; public function __construct($responses) @@ -75,6 +75,6 @@ class TestMultipleHttpKernel extends HttpKernel implements ControllerResolverInt public function reset() { - $this->call = false; + $this->called = false; } } diff --git a/src/Symfony/Component/Process/Tests/NonStopableProcess.php b/src/Symfony/Component/Process/Tests/NonStopableProcess.php index 692feebba2..54510c16a3 100644 --- a/src/Symfony/Component/Process/Tests/NonStopableProcess.php +++ b/src/Symfony/Component/Process/Tests/NonStopableProcess.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + /** * Runs a PHP script that can be stopped only with a SIGKILL (9) signal for 3 seconds. * diff --git a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index 26673ea45a..bbd7ddfeb2 100644 --- a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + define('ERR_SELECT_FAILED', 1); define('ERR_TIMEOUT', 2); define('ERR_READ_FAILED', 3); diff --git a/src/Symfony/Component/Process/Tests/SignalListener.php b/src/Symfony/Component/Process/Tests/SignalListener.php index bd4d138b04..4206550f5b 100644 --- a/src/Symfony/Component/Process/Tests/SignalListener.php +++ b/src/Symfony/Component/Process/Tests/SignalListener.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + // required for signal handling declare (ticks = 1); diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php index 5955049246..3767e08c82 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php @@ -1,7 +1,7 @@ * diff --git a/src/Symfony/Component/PropertyInfo/composer.json b/src/Symfony/Component/PropertyInfo/composer.json index fba75b69c2..629fea6820 100644 --- a/src/Symfony/Component/PropertyInfo/composer.json +++ b/src/Symfony/Component/PropertyInfo/composer.json @@ -26,8 +26,8 @@ "php": ">=5.3.9" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7", - "symfony/serializer": "~2.7", + "symfony/phpunit-bridge": "~2.7|~3.0.0", + "symfony/serializer": "~2.7|~3.0.0", "phpdocumentor/reflection": "^1.0.7", "doctrine/annotations": "~1.0" }, diff --git a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php index ef942b8526..7cefef134f 100644 --- a/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php +++ b/src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php @@ -77,7 +77,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface */ public function supportsAttribute($attribute) { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); foreach ($this->voters as $voter) { if ($voter->supportsAttribute($attribute)) { @@ -93,7 +93,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface */ public function supportsClass($class) { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); foreach ($this->voters as $voter) { if ($voter->supportsClass($class)) { diff --git a/src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php b/src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php index 2cafc5f952..12b54db529 100644 --- a/src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php +++ b/src/Symfony/Component/Security/Core/Authorization/Voter/AbstractVoter.php @@ -26,7 +26,7 @@ abstract class AbstractVoter implements VoterInterface */ public function supportsAttribute($attribute) { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); return in_array($attribute, $this->getSupportedAttributes()); } @@ -36,7 +36,7 @@ abstract class AbstractVoter implements VoterInterface */ public function supportsClass($class) { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); foreach ($this->getSupportedClasses() as $supportedClass) { if ($supportedClass === $class || is_subclass_of($class, $supportedClass)) { @@ -70,12 +70,6 @@ abstract class AbstractVoter implements VoterInterface $vote = self::ACCESS_ABSTAIN; $class = get_class($object); - $reflector = new \ReflectionMethod($this, 'voteOnAttribute'); - $isNewOverwritten = $reflector->getDeclaringClass()->getName() !== 'Symfony\Component\Security\Core\Authorization\Voter\AbstractVoter'; - if (!$isNewOverwritten) { - @trigger_error(sprintf("The AbstractVoter::isGranted method is deprecated since 2.8 and won't be called anymore in 3.0. Override voteOnAttribute() instead.", $reflector->class), E_USER_DEPRECATED); - } - foreach ($attributes as $attribute) { if (!$this->supports($attribute, $class)) { continue; @@ -84,16 +78,9 @@ abstract class AbstractVoter implements VoterInterface // as soon as at least one attribute is supported, default is to deny access $vote = self::ACCESS_DENIED; - if ($isNewOverwritten) { - if ($this->voteOnAttribute($attribute, $object, $token)) { - // grant access as soon as at least one voter returns a positive response - return self::ACCESS_GRANTED; - } - } else { - if ($this->isGranted($attribute, $object, $token->getUser())) { - // grant access as soon as at least one voter returns a positive response - return self::ACCESS_GRANTED; - } + if ($this->voteOnAttribute($attribute, $object, $token)) { + // grant access as soon as at least one voter returns a positive response + return self::ACCESS_GRANTED; } } @@ -115,7 +102,7 @@ abstract class AbstractVoter implements VoterInterface */ protected function supports($attribute, $class) { - @trigger_error('The getSupportedClasses and getSupportedAttributes methods are deprecated since version 2.8 and will be removed in version 3.0. Overwrite supports instead.'); + @trigger_error('The getSupportedClasses and getSupportedAttributes methods are deprecated since version 2.8 and will be removed in version 3.0. Overwrite supports instead.', E_USER_DEPRECATED); $classIsSupported = false; foreach ($this->getSupportedClasses() as $supportedClass) { @@ -159,7 +146,7 @@ abstract class AbstractVoter implements VoterInterface */ protected function getSupportedClasses() { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); } /** @@ -171,7 +158,7 @@ abstract class AbstractVoter implements VoterInterface */ protected function getSupportedAttributes() { - @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.'); + @trigger_error('The '.__METHOD__.' is deprecated since version 2.8 and will be removed in version 3.0.', E_USER_DEPRECATED); } /** @@ -191,7 +178,8 @@ abstract class AbstractVoter implements VoterInterface */ protected function isGranted($attribute, $object, $user = null) { - return false; + // forces isGranted() or voteOnAttribute() to be overridden + throw new \BadMethodCallException(sprintf('You must override the voteOnAttribute() method in "%s".', get_class($this))); } /** @@ -211,6 +199,9 @@ abstract class AbstractVoter implements VoterInterface */ protected function voteOnAttribute($attribute, $object, TokenInterface $token) { - return false; + // the user should override this method, and not rely on the deprecated isGranted() + @trigger_error(sprintf("The AbstractVoter::isGranted() method is deprecated since 2.8 and won't be called anymore in 3.0. Override voteOnAttribute() in %s instead.", get_class($this)), E_USER_DEPRECATED); + + return $this->isGranted($attribute, $object, $token->getUser()); } } diff --git a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php index 44da147ea9..ea72e75954 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/AbstractVoterTest.php @@ -19,17 +19,10 @@ use Symfony\Component\Security\Core\Authorization\Voter\AbstractVoter; */ class AbstractVoterTest extends \PHPUnit_Framework_TestCase { - /** - * @var AbstractVoter - */ - private $voter; - private $token; protected function setUp() { - $this->voter = new VoterFixture(); - $tokenMock = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); $tokenMock ->expects($this->any()) @@ -44,7 +37,9 @@ class AbstractVoterTest extends \PHPUnit_Framework_TestCase */ public function testVote($expectedVote, $object, $attributes, $message) { - $this->assertEquals($expectedVote, $this->voter->vote($this->token, $object, $attributes), $message); + $voter = new VoterFixture(); + + $this->assertEquals($expectedVote, $voter->vote($this->token, $object, $attributes), $message); } /** @@ -58,6 +53,16 @@ class AbstractVoterTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expectedVote, $voter->vote($this->token, $object, $attributes), $message); } + /** + * @group legacy + * @expectedException \BadMethodCallException + */ + public function testNoOverriddenMethodsThrowsException() + { + $voter = new DeprecatedVoterNothingImplementedFixture(); + $voter->vote($this->token, new ObjectFixture(), array('foo')); + } + public function getData() { return array( @@ -113,6 +118,23 @@ class DeprecatedVoterFixture extends AbstractVoter } } +class DeprecatedVoterNothingImplementedFixture extends AbstractVoter +{ + protected function getSupportedClasses() + { + return array( + 'Symfony\Component\Security\Core\Tests\Authorization\Voter\ObjectFixture', + ); + } + + protected function getSupportedAttributes() + { + return array('foo', 'bar', 'baz'); + } + + // this is a bad voter that hasn't overridden isGranted or voteOnAttribute +} + class ObjectFixture { } diff --git a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php index 3a0cf1eb39..b49f23f5bb 100644 --- a/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php +++ b/src/Symfony/Component/Security/Core/Tests/Authorization/Voter/LegacyAbstractVoterTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Security\Core\Tests\Authorization\Voter; use Symfony\Component\Security\Core\Authorization\Voter\AbstractVoter; diff --git a/src/Symfony/Component/Security/Core/Util/SecureRandom.php b/src/Symfony/Component/Security/Core/Util/SecureRandom.php index f4167e4d2f..65722ce3ef 100644 --- a/src/Symfony/Component/Security/Core/Util/SecureRandom.php +++ b/src/Symfony/Component/Security/Core/Util/SecureRandom.php @@ -43,9 +43,9 @@ final class SecureRandom implements SecureRandomInterface $this->logger = $logger; // determine whether to use OpenSSL - if (!function_exists('openssl_random_pseudo_bytes')) { + if (!function_exists('random_bytes') && !function_exists('openssl_random_pseudo_bytes')) { if (null !== $this->logger) { - $this->logger->notice('It is recommended that you enable the "openssl" extension for random number generation.'); + $this->logger->notice('It is recommended that you install the "paragonie/random_compat" library or enable the "openssl" extension for random number generation.'); } $this->useOpenSsl = false; } else { @@ -58,6 +58,10 @@ final class SecureRandom implements SecureRandomInterface */ public function nextBytes($nbBytes) { + if (function_exists('random_bytes')) { + return random_bytes($nbBytes); + } + // try OpenSSL if ($this->useOpenSsl) { $bytes = openssl_random_pseudo_bytes($nbBytes, $strong); diff --git a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php index 6140be0980..0ac7c12fef 100644 --- a/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php +++ b/src/Symfony/Component/Security/Guard/Firewall/GuardAuthenticationListener.php @@ -66,7 +66,7 @@ class GuardAuthenticationListener implements ListenerInterface public function handle(GetResponseEvent $event) { if (null !== $this->logger) { - $this->logger->info('Checking for guard authentication credentials.', array('firewall_key' => $this->providerKey, 'authenticators' => count($this->guardAuthenticators))); + $this->logger->debug('Checking for guard authentication credentials.', array('firewall_key' => $this->providerKey, 'authenticators' => count($this->guardAuthenticators))); } foreach ($this->guardAuthenticators as $key => $guardAuthenticator) { @@ -75,6 +75,12 @@ class GuardAuthenticationListener implements ListenerInterface $uniqueGuardKey = $this->providerKey.'_'.$key; $this->executeGuardAuthenticator($uniqueGuardKey, $guardAuthenticator, $event); + + if ($event->hasResponse()) { + $this->logger->debug(sprintf('The "%s" authenticator set the response. Any later authenticator will not be called', get_class($guardAuthenticator))); + + break; + } } } @@ -83,7 +89,7 @@ class GuardAuthenticationListener implements ListenerInterface $request = $event->getRequest(); try { if (null !== $this->logger) { - $this->logger->info('Calling getCredentials on guard configurator.', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Calling getCredentials() on guard configurator.', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator))); } // allow the authenticator to fetch authentication info from the request @@ -98,7 +104,7 @@ class GuardAuthenticationListener implements ListenerInterface $token = new PreAuthenticationGuardToken($credentials, $uniqueGuardKey); if (null !== $this->logger) { - $this->logger->info('Passing guard token information to the GuardAuthenticationProvider', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Passing guard token information to the GuardAuthenticationProvider', array('firewall_key' => $this->providerKey, 'authenticator' => get_class($guardAuthenticator))); } // pass the token into the AuthenticationManager system // this indirectly calls GuardAuthenticationProvider::authenticate() @@ -130,13 +136,13 @@ class GuardAuthenticationListener implements ListenerInterface $response = $this->guardHandler->handleAuthenticationSuccess($token, $request, $guardAuthenticator, $this->providerKey); if ($response instanceof Response) { if (null !== $this->logger) { - $this->logger->info('Guard authenticator set success response.', array('response' => $response, 'authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Guard authenticator set success response.', array('response' => $response, 'authenticator' => get_class($guardAuthenticator))); } $event->setResponse($response); } else { if (null !== $this->logger) { - $this->logger->info('Guard authenticator set no success response: request continues.', array('authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Guard authenticator set no success response: request continues.', array('authenticator' => get_class($guardAuthenticator))); } } @@ -167,7 +173,7 @@ class GuardAuthenticationListener implements ListenerInterface { if (null === $this->rememberMeServices) { if (null !== $this->logger) { - $this->logger->info('Remember me skipped: it is not configured for the firewall.', array('authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Remember me skipped: it is not configured for the firewall.', array('authenticator' => get_class($guardAuthenticator))); } return; @@ -175,7 +181,7 @@ class GuardAuthenticationListener implements ListenerInterface if (!$guardAuthenticator->supportsRememberMe()) { if (null !== $this->logger) { - $this->logger->info('Remember me skipped: your authenticator does not support it.', array('authenticator' => get_class($guardAuthenticator))); + $this->logger->debug('Remember me skipped: your authenticator does not support it.', array('authenticator' => get_class($guardAuthenticator))); } return; diff --git a/src/Symfony/Component/Security/Guard/Tests/Firewall/GuardAuthenticationListenerTest.php b/src/Symfony/Component/Security/Guard/Tests/Firewall/GuardAuthenticationListenerTest.php index 8fab3991f9..3224fee78d 100644 --- a/src/Symfony/Component/Security/Guard/Tests/Firewall/GuardAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Guard/Tests/Firewall/GuardAuthenticationListenerTest.php @@ -79,6 +79,36 @@ class GuardAuthenticationListenerTest extends \PHPUnit_Framework_TestCase $listener->handle($this->event); } + public function testHandleSuccessStopsAfterResponseIsSet() + { + $authenticator1 = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface'); + $authenticator2 = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface'); + + // mock the first authenticator to fail, and set a Response + $authenticator1 + ->expects($this->once()) + ->method('getCredentials') + ->willThrowException(new AuthenticationException()); + $this->guardAuthenticatorHandler + ->expects($this->once()) + ->method('handleAuthenticationFailure') + ->willReturn(new Response()); + // the second authenticator should *never* be called + $authenticator2 + ->expects($this->never()) + ->method('getCredentials'); + + $listener = new GuardAuthenticationListener( + $this->guardAuthenticatorHandler, + $this->authenticationManager, + 'my_firewall', + array($authenticator1, $authenticator2), + $this->logger + ); + + $listener->handle($this->event); + } + public function testHandleSuccessWithRememberMe() { $authenticator = $this->getMock('Symfony\Component\Security\Guard\GuardAuthenticatorInterface'); @@ -201,7 +231,10 @@ class GuardAuthenticationListenerTest extends \PHPUnit_Framework_TestCase $this->request = new Request(array(), array(), array(), array(), array(), array()); - $this->event = $this->getMock('Symfony\Component\HttpKernel\Event\GetResponseEvent', array(), array(), '', false); + $this->event = $this->getMockBuilder('Symfony\Component\HttpKernel\Event\GetResponseEvent') + ->disableOriginalConstructor() + ->setMethods(array('getRequest')) + ->getMock(); $this->event ->expects($this->any()) ->method('getRequest') @@ -218,5 +251,6 @@ class GuardAuthenticationListenerTest extends \PHPUnit_Framework_TestCase $this->event = null; $this->logger = null; $this->request = null; + $this->rememberMeServices = null; } } diff --git a/src/Symfony/Component/Security/Guard/Token/GuardTokenInterface.php b/src/Symfony/Component/Security/Guard/Token/GuardTokenInterface.php index f0db250dd3..063ffd3ba7 100644 --- a/src/Symfony/Component/Security/Guard/Token/GuardTokenInterface.php +++ b/src/Symfony/Component/Security/Guard/Token/GuardTokenInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Security\Guard\Token; +use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; + /** * A marker interface that both guard tokens implement. * @@ -20,6 +22,6 @@ namespace Symfony\Component\Security\Guard\Token; * * @author Ryan Weaver */ -interface GuardTokenInterface +interface GuardTokenInterface extends TokenInterface { } diff --git a/src/Symfony/Component/Security/composer.json b/src/Symfony/Component/Security/composer.json index 3bea5b8a4c..547c1ce388 100644 --- a/src/Symfony/Component/Security/composer.json +++ b/src/Symfony/Component/Security/composer.json @@ -24,6 +24,7 @@ "replace": { "symfony/security-core": "self.version", "symfony/security-csrf": "self.version", + "symfony/security-guard": "self.version", "symfony/security-http": "self.version" }, "require-dev": { @@ -41,10 +42,11 @@ "suggest": { "symfony/class-loader": "For using the ACL generateSql script", "symfony/finder": "For using the ACL generateSql script", + "symfony/form": "", "symfony/validator": "For using the user password constraint", "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs", - "doctrine/dbal": "For using the built-in ACL implementation", - "symfony/expression-language": "For using the expression voter" + "symfony/expression-language": "For using the expression voter", + "paragonie/random_compat": "" }, "autoload": { "psr-4": { "Symfony\\Component\\Security\\": "" } diff --git a/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php b/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php index 6e746f29fe..882d6bd19c 100644 --- a/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Serializer\Normalizer; /* diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php index c7bd11e7ae..c064503430 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php @@ -17,6 +17,9 @@ use Symfony\Component\Serializer\Normalizer\CustomNormalizer; class JsonEncoderTest extends \PHPUnit_Framework_TestCase { + private $encoder; + private $serializer; + protected function setUp() { $this->encoder = new JsonEncoder(); diff --git a/src/Symfony/Component/Serializer/Tests/SerializerTest.php b/src/Symfony/Component/Serializer/Tests/SerializerTest.php index 43dfe29e00..68b648907f 100644 --- a/src/Symfony/Component/Serializer/Tests/SerializerTest.php +++ b/src/Symfony/Component/Serializer/Tests/SerializerTest.php @@ -41,21 +41,21 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testNormalizeNoMatch() { - $this->serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer'))); - $this->serializer->normalize(new \stdClass(), 'xml'); + $serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer'))); + $serializer->normalize(new \stdClass(), 'xml'); } public function testNormalizeTraversable() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); - $result = $this->serializer->serialize(new TraversableDummy(), 'json'); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $result = $serializer->serialize(new TraversableDummy(), 'json'); $this->assertEquals('{"foo":"foo","bar":"bar"}', $result); } public function testNormalizeGivesPriorityToInterfaceOverTraversable() { - $this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder())); - $result = $this->serializer->serialize(new NormalizableTraversableDummy(), 'json'); + $serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder())); + $result = $serializer->serialize(new NormalizableTraversableDummy(), 'json'); $this->assertEquals('{"foo":"normalizedFoo","bar":"normalizedBar"}', $result); } @@ -64,8 +64,8 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testNormalizeOnDenormalizer() { - $this->serializer = new Serializer(array(new TestDenormalizer()), array()); - $this->assertTrue($this->serializer->normalize(new \stdClass(), 'json')); + $serializer = new Serializer(array(new TestDenormalizer()), array()); + $this->assertTrue($serializer->normalize(new \stdClass(), 'json')); } /** @@ -73,8 +73,8 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testDenormalizeNoMatch() { - $this->serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer'))); - $this->serializer->denormalize('foo', 'stdClass'); + $serializer = new Serializer(array($this->getMock('Symfony\Component\Serializer\Normalizer\CustomNormalizer'))); + $serializer->denormalize('foo', 'stdClass'); } /** @@ -82,40 +82,40 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testDenormalizeOnNormalizer() { - $this->serializer = new Serializer(array(new TestNormalizer()), array()); + $serializer = new Serializer(array(new TestNormalizer()), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->assertTrue($this->serializer->denormalize(json_encode($data), 'stdClass', 'json')); + $this->assertTrue($serializer->denormalize(json_encode($data), 'stdClass', 'json')); } public function testCustomNormalizerCanNormalizeCollectionsAndScalar() { - $this->serializer = new Serializer(array(new TestNormalizer()), array()); - $this->assertNull($this->serializer->normalize(array('a', 'b'))); - $this->assertNull($this->serializer->normalize(new \ArrayObject(array('c', 'd')))); - $this->assertNull($this->serializer->normalize(array())); - $this->assertNull($this->serializer->normalize('test')); + $serializer = new Serializer(array(new TestNormalizer()), array()); + $this->assertNull($serializer->normalize(array('a', 'b'))); + $this->assertNull($serializer->normalize(new \ArrayObject(array('c', 'd')))); + $this->assertNull($serializer->normalize(array())); + $this->assertNull($serializer->normalize('test')); } public function testSerialize() { - $this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $result = $this->serializer->serialize(Model::fromArray($data), 'json'); + $result = $serializer->serialize(Model::fromArray($data), 'json'); $this->assertEquals(json_encode($data), $result); } public function testSerializeScalar() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); - $result = $this->serializer->serialize('foo', 'json'); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $result = $serializer->serialize('foo', 'json'); $this->assertEquals('"foo"', $result); } public function testSerializeArrayOfScalars() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); $data = array('foo', array(5, 3)); - $result = $this->serializer->serialize($data, 'json'); + $result = $serializer->serialize($data, 'json'); $this->assertEquals(json_encode($data), $result); } @@ -124,9 +124,9 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testSerializeNoEncoder() { - $this->serializer = new Serializer(array(), array()); + $serializer = new Serializer(array(), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->serialize($data, 'json'); + $serializer->serialize($data, 'json'); } /** @@ -134,26 +134,26 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testSerializeNoNormalizer() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->serialize(Model::fromArray($data), 'json'); + $serializer->serialize(Model::fromArray($data), 'json'); } public function testDeserialize() { - $this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $result = $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $result = $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); $this->assertEquals($data, $result->toArray()); } public function testDeserializeUseCache() { - $this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(new GetSetMethodNormalizer()), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); $data = array('title' => 'bar', 'numbers' => array(2, 8)); - $result = $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $result = $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); $this->assertEquals($data, $result->toArray()); } @@ -162,9 +162,9 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testDeserializeNoNormalizer() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); } /** @@ -172,9 +172,9 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testDeserializeWrongNormalizer() { - $this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder())); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); } /** @@ -182,45 +182,45 @@ class SerializerTest extends \PHPUnit_Framework_TestCase */ public function testDeserializeNoEncoder() { - $this->serializer = new Serializer(array(), array()); + $serializer = new Serializer(array(), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); + $serializer->deserialize(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json'); } public function testDeserializeSupported() { - $this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array()); + $serializer = new Serializer(array(new GetSetMethodNormalizer()), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->assertTrue($this->serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json')); + $this->assertTrue($serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json')); } public function testDeserializeNotSupported() { - $this->serializer = new Serializer(array(new GetSetMethodNormalizer()), array()); + $serializer = new Serializer(array(new GetSetMethodNormalizer()), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->assertFalse($this->serializer->supportsDenormalization(json_encode($data), 'stdClass', 'json')); + $this->assertFalse($serializer->supportsDenormalization(json_encode($data), 'stdClass', 'json')); } public function testDeserializeNotSupportedMissing() { - $this->serializer = new Serializer(array(), array()); + $serializer = new Serializer(array(), array()); $data = array('title' => 'foo', 'numbers' => array(5, 3)); - $this->assertFalse($this->serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json')); + $this->assertFalse($serializer->supportsDenormalization(json_encode($data), '\Symfony\Component\Serializer\Tests\Model', 'json')); } public function testEncode() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); $data = array('foo', array(5, 3)); - $result = $this->serializer->encode($data, 'json'); + $result = $serializer->encode($data, 'json'); $this->assertEquals(json_encode($data), $result); } public function testDecode() { - $this->serializer = new Serializer(array(), array('json' => new JsonEncoder())); + $serializer = new Serializer(array(), array('json' => new JsonEncoder())); $data = array('foo', array(5, 3)); - $result = $this->serializer->decode(json_encode($data), 'json'); + $result = $serializer->decode(json_encode($data), 'json'); $this->assertEquals($data, $result); } diff --git a/src/Symfony/Component/Validator/Constraints/Bic.php b/src/Symfony/Component/Validator/Constraints/Bic.php index 0cf32d6227..f8fa94d81d 100644 --- a/src/Symfony/Component/Validator/Constraints/Bic.php +++ b/src/Symfony/Component/Validator/Constraints/Bic.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; diff --git a/src/Symfony/Component/Validator/Constraints/BicValidator.php b/src/Symfony/Component/Validator/Constraints/BicValidator.php index 63b0996923..2e645705aa 100644 --- a/src/Symfony/Component/Validator/Constraints/BicValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BicValidator.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf index a972c02e56..a113a7241b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.hu.xlf @@ -310,6 +310,10 @@ This value does not match the expected {{ charset }} charset. Ez az érték nem az elvárt {{ charset }} karakterkódolást használja. + + This is not a valid Business Identifier Code (BIC). + Érvénytelen nemzetközi bankazonosító kód (BIC/SWIFT). + diff --git a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php index 07fee88ea1..6b945639ab 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/BicValidatorTest.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\BicValidator; diff --git a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php index 08f219d0a4..d032f0e8ca 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/Loader/AbstractStaticMethodLoader.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + namespace Symfony\Component\Validator\Tests\Mapping\Loader; use Symfony\Component\Validator\Mapping\ClassMetadata; diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index d632d05d3f..e27f6f637f 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -44,6 +44,16 @@ class RecursiveContextualValidator implements ContextualValidatorInterface */ private $context; + /** + * @var string + */ + private $defaultPropertyPath; + + /** + * @var array + */ + private $defaultGroups; + /** * @var MetadataFactoryInterface */ diff --git a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php index 26414b55a8..37e4110abe 100644 --- a/src/Symfony/Component/VarDumper/Dumper/CliDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/CliDumper.php @@ -448,7 +448,7 @@ class CliDumper extends AbstractDumper } if ('\\' === DIRECTORY_SEPARATOR) { - static::$defaultColors = @(false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI')); + static::$defaultColors = @(false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI') || 'xterm' === getenv('TERM')); } elseif (function_exists('posix_isatty')) { $h = stream_get_meta_data($this->outputStream) + array('wrapper_type' => null); $h = 'Output' === $h['stream_type'] && 'PHP' === $h['wrapper_type'] ? fopen('php://stdout', 'wb') : $this->outputStream; diff --git a/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php b/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php index ce2ab4d4b4..c1b427b92e 100644 --- a/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php +++ b/src/Symfony/Component/VarDumper/Exception/ThrowingCasterException.php @@ -1,13 +1,13 @@ -* -* For the full copyright and license information, please view the LICENSE -* file that was distributed with this source code. -*/ + * This file is part of the Symfony package. + * + * (c) Fabien Potencier + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ namespace Symfony\Component\VarDumper\Exception;