- {{ form_label(form, label|default(null)) }}
+ {{ form_label(form) }}
{{ form_errors(form) }}
{{ form_widget(form) }}
diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
index 27f830f..63bd7d2 100644
--- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
+++ b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Resources/views/Form/form_table_layout.html.twig
@@ -4,7 +4,7 @@
{% spaceless %}
- {{ form_label(form, label|default(null)) }}
+ {{ form_label(form) }}
|
{{ form_errors(form) }}
diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
index 043d8c9..903db69 100644
--- a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php
@@ -134,7 +134,7 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest
*/
public function testIsChoiceSelected($expected, $choice, $value)
{
- $choice = new ChoiceView($choice, $choice . ' label');
+ $choice = new ChoiceView($choice, $choice, $choice . ' label');
$this->assertSame($expected, $this->extension->isSelectedChoice($choice, $value));
}
diff --git a/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php
new file mode 100644
index 0000000..c1f247c
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Bridge/Twig/Tests/Node/SearchAndRenderBlockNodeTest.php
@@ -0,0 +1,282 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Bridge\Twig\Tests\Node;
+
+use Symfony\Bridge\Twig\Tests\TestCase;
+use Symfony\Bridge\Twig\Node\SearchAndRenderBlockNode;
+
+class SearchAndRenderBlockNodeTest extends TestCase
+{
+ protected function setUp()
+ {
+ parent::setUp();
+
+ if (version_compare(\Twig_Environment::VERSION, '1.5.0', '<')) {
+ $this->markTestSkipped('Requires Twig version to be at least 1.5.0.');
+ }
+ }
+
+ public function testCompileWidget()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'widget\')',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileWidgetWithVariables()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Array(array(
+ new \Twig_Node_Expression_Constant('foo', 0),
+ new \Twig_Node_Expression_Constant('bar', 0),
+ ), 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_widget', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'widget\', array("foo" => "bar"))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithLabel()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Constant('my label', 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("label" => "my label"))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithNullLabel()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Constant(null, 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ // "label" => null must not be included in the output!
+ // Otherwise the default label is overwritten with null.
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithEmptyStringLabel()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Constant('', 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ // "label" => null must not be included in the output!
+ // Otherwise the default label is overwritten with null.
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithDefaultLabel()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\')',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithAttributes()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Constant(null, 0),
+ new \Twig_Node_Expression_Array(array(
+ new \Twig_Node_Expression_Constant('foo', 0),
+ new \Twig_Node_Expression_Constant('bar', 0),
+ ), 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ // "label" => null must not be included in the output!
+ // Otherwise the default label is overwritten with null.
+ // https://github.com/symfony/symfony/issues/5029
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar"))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithLabelAndAttributes()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Constant('value in argument', 0),
+ new \Twig_Node_Expression_Array(array(
+ new \Twig_Node_Expression_Constant('foo', 0),
+ new \Twig_Node_Expression_Constant('bar', 0),
+ new \Twig_Node_Expression_Constant('label', 0),
+ new \Twig_Node_Expression_Constant('value in attributes', 0),
+ ), 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in argument"))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithLabelThatEvaluatesToNull()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Conditional(
+ // if
+ new \Twig_Node_Expression_Constant(true, 0),
+ // then
+ new \Twig_Node_Expression_Constant(null, 0),
+ // else
+ new \Twig_Node_Expression_Constant(null, 0),
+ 0
+ ),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ // "label" => null must not be included in the output!
+ // Otherwise the default label is overwritten with null.
+ // https://github.com/symfony/symfony/issues/5029
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ public function testCompileLabelWithLabelThatEvaluatesToNullAndAttributes()
+ {
+ $arguments = new \Twig_Node(array(
+ new \Twig_Node_Expression_Name('form', 0),
+ new \Twig_Node_Expression_Conditional(
+ // if
+ new \Twig_Node_Expression_Constant(true, 0),
+ // then
+ new \Twig_Node_Expression_Constant(null, 0),
+ // else
+ new \Twig_Node_Expression_Constant(null, 0),
+ 0
+ ),
+ new \Twig_Node_Expression_Array(array(
+ new \Twig_Node_Expression_Constant('foo', 0),
+ new \Twig_Node_Expression_Constant('bar', 0),
+ new \Twig_Node_Expression_Constant('label', 0),
+ new \Twig_Node_Expression_Constant('value in attributes', 0),
+ ), 0),
+ ));
+
+ $node = new SearchAndRenderBlockNode('form_label', $arguments, 0);
+
+ $compiler = new \Twig_Compiler(new \Twig_Environment());
+
+ // "label" => null must not be included in the output!
+ // Otherwise the default label is overwritten with null.
+ // https://github.com/symfony/symfony/issues/5029
+ $this->assertEquals(
+ sprintf(
+ '$this->env->getExtension(\'form\')->renderer->searchAndRenderBlock(%s, \'label\', array("foo" => "bar", "label" => "value in attributes") + (twig_test_empty($_label_ = ((true) ? (null) : (null))) ? array() : array("label" => $_label_)))',
+ $this->getVariableGetter('form')
+ ),
+ trim($compiler->compile($node)->getSource())
+ );
+ }
+
+ protected function getVariableGetter($name)
+ {
+ if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
+ return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
+ }
+
+ return sprintf('$this->getContext($context, "%s")', $name);
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
index bc145a2..0159fbc 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php
@@ -33,7 +33,7 @@ class AssetsInstallCommand extends ContainerAwareCommand
$this
->setName('assets:install')
->setDefinition(array(
- new InputArgument('target', InputArgument::REQUIRED, 'The target directory (usually "web")'),
+ new InputArgument('target', InputArgument::OPTIONAL, 'The target directory', 'web'),
))
->addOption('symlink', null, InputOption::VALUE_NONE, 'Symlinks the assets instead of copying it')
->addOption('relative', null, InputOption::VALUE_NONE, 'Make relative symlinks')
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php
index b6d94af..06a0d19 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/RegisterKernelListenersPass.php
@@ -44,7 +44,7 @@ class RegisterKernelListenersPass implements CompilerPassInterface
}
foreach ($container->findTaggedServiceIds('kernel.event_subscriber') as $id => $attributes) {
- // We must assume that the class value has been correcly filled, even if the service is created by a factory
+ // We must assume that the class value has been correctly filled, even if the service is created by a factory
$class = $container->getDefinition($id)->getClass();
$refClass = new \ReflectionClass($class);
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
index 523bd17..ddc5994 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php
@@ -196,9 +196,10 @@ class HttpKernel extends BaseHttpKernel
*
* This method uses the "_internal" route, which should be available.
*
- * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
- * @param array $attributes An array of request attributes
- * @param array $query An array of request query parameters
+ * @param string $controller A controller name to execute (a string like BlogBundle:Post:index), or a relative URI
+ * @param array $attributes An array of request attributes
+ * @param array $query An array of request query parameters
+ * @param boolean $secure
*
* @return string An internal URI
*/
@@ -226,6 +227,7 @@ class HttpKernel extends BaseHttpKernel
* Renders an HInclude tag.
*
* @param string $uri A URI
+ * @param string $defaultContent Default content
*/
public function renderHIncludeTag($uri, $defaultContent = null)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
index 8bef4bc..d2df3eb 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/form.xml
@@ -5,47 +5,45 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
- Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension
+ Symfony\Component\Form\ResolvedFormTypeFactory
Symfony\Component\Form\FormRegistry
Symfony\Component\Form\FormFactory
+ Symfony\Component\Form\Extension\DependencyInjection\DependencyInjectionExtension
Symfony\Component\Form\Extension\Validator\ValidatorTypeGuesser
+
+
+
+
+
-
+
-
+
-
+
@@ -138,6 +136,11 @@
+
+
+
+
+
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
index d4d181a..ff6c6f5 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml
@@ -22,6 +22,8 @@
%kernel.name%%kernel.environment%UrlMatcher
%kernel.name%%kernel.environment%UrlGenerator
Symfony\Component\HttpKernel\EventListener\RouterListener
+ localhost
+ http
@@ -74,8 +76,8 @@
GET
- localhost
- http
+ %router.request_context.host%
+ %router.request_context.scheme%
%request_listener.http_port%
%request_listener.https_port%
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php
index 0918070..a4f86d0 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/form_row.html.php
@@ -1,5 +1,5 @@
- label($form, isset($label) ? $label : null) ?>
+ label($form) ?>
errors($form) ?>
widget($form) ?>
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php
index b9e5c56..7e1f2f5 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/views/FormTable/form_row.html.php
@@ -1,6 +1,6 @@
- label($form, isset($label) ? $label : null) ?>
+ label($form) ?>
|
errors($form) ?>
diff --git a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
index b8c6a02..e271bc5 100644
--- a/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
+++ b/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php
@@ -125,7 +125,7 @@ class FormHelper extends Helper
*/
public function label(FormView $view, $label = null, array $variables = array())
{
- if ($label !== null) {
+ if (null !== $label) {
$variables += array('label' => $label);
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php
index b5d5a0d..91d52df 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/ClientTest.php
@@ -224,6 +224,25 @@ class ClientTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() clicks on links');
}
+ public function testClickForm()
+ {
+ if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
+ $this->markTestSkipped('The "DomCrawler" component is not available');
+ }
+
+ if (!class_exists('Symfony\Component\CssSelector\CssSelector')) {
+ $this->markTestSkipped('The "CssSelector" component is not available');
+ }
+
+ $client = new TestClient();
+ $client->setNextResponse(new Response(''));
+ $crawler = $client->request('GET', 'http://www.example.com/foo/foobar');
+
+ $client->click($crawler->filter('input')->form());
+
+ $this->assertEquals('http://www.example.com/foo', $client->getRequest()->getUri(), '->click() Form submit forms');
+ }
+
public function testSubmit()
{
if (!class_exists('Symfony\Component\DomCrawler\Crawler')) {
diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php
index 218c688..0c077d3 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php
@@ -144,6 +144,29 @@ class CookieJarTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('foo' => 'bar%3Dbaz'), $cookieJar->allRawValues('/'));
}
+ public function testCookieExpireWithSameNameButDifferentPaths()
+ {
+ $cookieJar = new CookieJar();
+ $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/foo'));
+ $cookieJar->set($cookie2 = new Cookie('foo', 'bar2', null, '/bar'));
+ $cookieJar->expire('foo', '/foo');
+
+ $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired');
+ $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/')));
+ $this->assertEquals(array(), $cookieJar->allValues('http://example.com/foo'));
+ $this->assertEquals(array('foo' => 'bar2'), $cookieJar->allValues('http://example.com/bar'));
+ }
+
+ public function testCookieExpireWithNullPaths()
+ {
+ $cookieJar = new CookieJar();
+ $cookieJar->set($cookie1 = new Cookie('foo', 'bar1', null, '/'));
+ $cookieJar->expire('foo', null);
+
+ $this->assertNull($cookieJar->get('foo'), '->get() returns null if the cookie is expired');
+ $this->assertEquals(array(), array_keys($cookieJar->allValues('http://example.com/')));
+ }
+
public function testCookieWithSameNameButDifferentPaths()
{
$cookieJar = new CookieJar();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php
index fbc493a..2db3ac6 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/BrowserKit/Tests/CookieTest.php
@@ -58,6 +58,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase
array('foo=bar; expires=Fri, 31 Jul 2020 08:49:37 GMT'),
array('foo=bar; expires=Friday, 31-Jul-20 08:49:37 GMT'),
array('foo=bar; expires=Fri Jul 31 08:49:37 2020'),
+ array('foo=bar; expires=\'Fri Jul 31 08:49:37 2020\''),
);
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php
index 3c298a4..3831d70 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php
@@ -69,7 +69,7 @@ class ArrayNodeDefinitionTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException Symfony\Component\Config\Definition\Exception\InvalidDefinitionException
*/
- public function testPrototypeNodesCantHaveADefaultValueWhenUsingDefaulChildren()
+ public function testPrototypeNodesCantHaveADefaultValueWhenUsingDefaultChildren()
{
$node = new ArrayNodeDefinition('root');
$node
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php
index 6e7480f..11d20a4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php
@@ -200,9 +200,9 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase
/**
* Assert that the given test builder, will return the given value
- * @param mixed $value The value to test
- * @param TreeBuilder $test The tree builder to finalize
- * @param mixed $config The config values that new to be finalized
+ * @param mixed $value The value to test
+ * @param TreeBuilder $treeBuilder The tree builder to finalize
+ * @param mixed $config The config values that new to be finalized
*/
protected function assertFinalizedValueIs($value, $treeBuilder, $config=null)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php
index ca2b0e6..8afbaf8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Config/Tests/Definition/Builder/TreeBuilderTest.php
@@ -90,7 +90,7 @@ class TreeBuilderTest extends \PHPUnit_Framework_TestCase
->end();
}
- public function testDefinitionInfoGetsTransferedToNode()
+ public function testDefinitionInfoGetsTransferredToNode()
{
$builder = new TreeBuilder();
@@ -107,7 +107,7 @@ class TreeBuilderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('child info', $children['child']->getInfo());
}
- public function testDefinitionExampleGetsTransferedToNode()
+ public function testDefinitionExampleGetsTransferredToNode()
{
$builder = new TreeBuilder();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php
index cab5fe5..9fc8518 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php
@@ -1041,7 +1041,7 @@ class Application
* if nothing is found in $collection, try in $abbrevs
*
* @param string $name The string
- * @param array|Traversable $collection The collecion
+ * @param array|Traversable $collection The collection
* @param array $abbrevs The abbreviations
* @param Closure|string|array $callback The callable to transform collection item before comparison
*
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php
index b5a55fe..e8642b3 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php
@@ -50,7 +50,7 @@ interface OutputFormatterStyleInterface
/**
* Unsets some specific style option.
*
- * @param string $option Theoption name
+ * @param string $option The option name
*/
public function unsetOption($option);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php
index 9746507..da54d77 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php
@@ -224,7 +224,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application->add(new \Foo2Command());
try {
- $application->find($commandName = 'Unknow command');
+ $application->find($commandName = 'Unknown command');
$this->fail('->find() throws an \InvalidArgumentException if command does not exist');
} catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if command does not exist');
@@ -264,11 +264,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
$application->add(new \foo3Command());
try {
- $application->find('Unknow-namespace:Unknow-command');
+ $application->find('Unknown-namespace:Unknown-command');
$this->fail('->find() throws an \InvalidArgumentException if namespace does not exist');
} catch (\Exception $e) {
$this->assertInstanceOf('\InvalidArgumentException', $e, '->find() throws an \InvalidArgumentException if namespace does not exist');
- $this->assertEquals('There are no commands defined in the "Unknow-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives');
+ $this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws an \InvalidArgumentException if namespace does not exist, without alternatives');
}
try {
diff --git a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
index 9e21972..70592df 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/InlineServiceDefinitionsPass.php
@@ -81,7 +81,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
continue;
}
- if ($this->isInlinableDefinition($container, $id, $definition = $container->getDefinition($id))) {
+ if ($this->isInlineableDefinition($container, $id, $definition = $container->getDefinition($id))) {
$this->compiler->addLogMessage($this->formatter->formatInlineService($this, $id, $this->currentId));
if (ContainerInterface::SCOPE_PROTOTYPE !== $definition->getScope()) {
@@ -109,7 +109,7 @@ class InlineServiceDefinitionsPass implements RepeatablePassInterface
*
* @return Boolean If the definition is inlineable
*/
- private function isInlinableDefinition(ContainerBuilder $container, $id, Definition $definition)
+ private function isInlineableDefinition(ContainerBuilder $container, $id, Definition $definition)
{
if (ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) {
return true;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php b/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php
index 8bf81c9..34b0a9b 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php
@@ -27,9 +27,9 @@ class Filesystem
*
* By default, if the target already exists, it is not overridden.
*
- * @param string $originFile The original filename
- * @param string $targetFile The target filename
- * @param array $override Whether to override an existing file or not
+ * @param string $originFile The original filename
+ * @param string $targetFile The target filename
+ * @param boolean $override Whether to override an existing file or not
*
* @throws IOException When copy fails
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
index 3a935e1..94bd716 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php
@@ -31,7 +31,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
$this->filesystem = new Filesystem();
- $this->workspace = sys_get_temp_dir().DIRECTORY_SEPARATOR.time().rand(0, 1000);
+ $this->workspace = rtrim(sys_get_temp_dir(), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.time().rand(0, 1000);
mkdir($this->workspace, 0777, true);
}
@@ -319,7 +319,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
mkdir($basePath);
mkdir($basePath.'dir');
// create symlink to unexisting file
- symlink($basePath.'file', $basePath.'link');
+ @symlink($basePath.'file', $basePath.'link');
$this->filesystem->remove($basePath);
@@ -388,8 +388,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->filesystem->chmod($file, 0400);
$this->filesystem->chmod($dir, 0753);
- $this->assertEquals(753, $this->getFilePermisions($dir));
- $this->assertEquals(400, $this->getFilePermisions($file));
+ $this->assertEquals(753, $this->getFilePermissions($dir));
+ $this->assertEquals(400, $this->getFilePermissions($file));
}
public function testChmodWrongMod()
@@ -414,8 +414,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->filesystem->chmod($file, 0400, 0000, true);
$this->filesystem->chmod($dir, 0753, 0000, true);
- $this->assertEquals(753, $this->getFilePermisions($dir));
- $this->assertEquals(753, $this->getFilePermisions($file));
+ $this->assertEquals(753, $this->getFilePermissions($dir));
+ $this->assertEquals(753, $this->getFilePermissions($file));
}
public function testChmodAppliesUmask()
@@ -426,7 +426,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
touch($file);
$this->filesystem->chmod($file, 0770, 0022);
- $this->assertEquals(750, $this->getFilePermisions($file));
+ $this->assertEquals(750, $this->getFilePermissions($file));
}
public function testChmodChangesModeOfArrayOfFiles()
@@ -442,8 +442,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->filesystem->chmod($files, 0753);
- $this->assertEquals(753, $this->getFilePermisions($file));
- $this->assertEquals(753, $this->getFilePermisions($directory));
+ $this->assertEquals(753, $this->getFilePermissions($file));
+ $this->assertEquals(753, $this->getFilePermissions($directory));
}
public function testChmodChangesModeOfTraversableFileObject()
@@ -459,8 +459,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$this->filesystem->chmod($files, 0753);
- $this->assertEquals(753, $this->getFilePermisions($file));
- $this->assertEquals(753, $this->getFilePermisions($directory));
+ $this->assertEquals(753, $this->getFilePermissions($file));
+ $this->assertEquals(753, $this->getFilePermissions($directory));
}
public function testChown()
@@ -701,6 +701,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
$link1 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'link';
$link2 = $this->workspace.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'subdir'.DIRECTORY_SEPARATOR.'link';
+ touch($file);
+
$this->filesystem->symlink($file, $link1);
$this->filesystem->symlink($file, $link2);
@@ -830,13 +832,15 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
*
* @return integer
*/
- private function getFilePermisions($filePath)
+ private function getFilePermissions($filePath)
{
return (int) substr(sprintf('%o', fileperms($filePath)), -3);
}
private function getFileOwner($filepath)
{
+ $this->markAsSkippedIfPosixIsMissing();
+
$infos = stat($filepath);
if ($datas = posix_getpwuid($infos['uid'])) {
return $datas['name'];
@@ -845,6 +849,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
private function getFileGroup($filepath)
{
+ $this->markAsSkippedIfPosixIsMissing();
+
$infos = stat($filepath);
if ($datas = posix_getgrgid($infos['gid'])) {
return $datas['name'];
@@ -867,8 +873,8 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase
private function markAsSkippedIfPosixIsMissing()
{
- if (defined('PHP_WINDOWS_VERSION_MAJOR')) {
- $this->markTestSkipped('Posix uids are not available on windows');
+ if (defined('PHP_WINDOWS_VERSION_MAJOR') || !function_exists('posix_isatty')) {
+ $this->markTestSkipped('Posix is not supported');
}
}
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php
index dd870e2..8ff5739 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/CustomFilterIterator.php
@@ -19,7 +19,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class CustomFilterIterator extends \FilterIterator
+class CustomFilterIterator extends FilterIterator
{
private $filters = array();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php
index 8ed17b4..1664793 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DateRangeFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class DateRangeFilterIterator extends \FilterIterator
+class DateRangeFilterIterator extends FilterIterator
{
private $comparators = array();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php
index 7d58c38..8321253 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/DepthRangeFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class DepthRangeFilterIterator extends \FilterIterator
+class DepthRangeFilterIterator extends FilterIterator
{
private $minDepth = 0;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
index 40759c0..42c8ce7 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/ExcludeDirectoryFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class ExcludeDirectoryFilterIterator extends \FilterIterator
+class ExcludeDirectoryFilterIterator extends FilterIterator
{
private $patterns;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php
index da62ecf..5b7bbb1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FileTypeFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class FileTypeFilterIterator extends \FilterIterator
+class FileTypeFilterIterator extends FilterIterator
{
const ONLY_FILES = 1;
const ONLY_DIRECTORIES = 2;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilterIterator.php
new file mode 100644
index 0000000..64da508
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/FilterIterator.php
@@ -0,0 +1,42 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Finder\Iterator;
+
+/**
+ * This iterator just overrides the rewind method in order to correct a PHP bug.
+ *
+ * @see https://bugs.php.net/bug.php?id=49104
+ *
+ * @author Alex Bogomazov
+ */
+abstract class FilterIterator extends \FilterIterator
+{
+ /**
+ * This is a workaround for the problem with \FilterIterator leaving inner \FilesystemIterator in wrong state after
+ * rewind in some cases.
+ *
+ * @see FilterIterator::rewind()
+ */
+ public function rewind()
+ {
+ $iterator = $this;
+ while ($iterator instanceof \OuterIterator) {
+ if ($iterator->getInnerIterator() instanceof \FilesystemIterator) {
+ $iterator->getInnerIterator()->next();
+ $iterator->getInnerIterator()->rewind();
+ }
+ $iterator = $iterator->getInnerIterator();
+ }
+
+ parent::rewind();
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php
index 42199ab..12584b1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/MultiplePcreFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-abstract class MultiplePcreFilterIterator extends \FilterIterator
+abstract class MultiplePcreFilterIterator extends FilterIterator
{
protected $matchRegexps;
protected $noMatchRegexps;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php
index b9b8044..89a4fc4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Iterator/SizeRangeFilterIterator.php
@@ -16,7 +16,7 @@ namespace Symfony\Component\Finder\Iterator;
*
* @author Fabien Potencier
*/
-class SizeRangeFilterIterator extends \FilterIterator
+class SizeRangeFilterIterator extends FilterIterator
{
private $comparators = array();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/FinderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/FinderTest.php
index 05ed82f..ec7db1e 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/FinderTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/FinderTest.php
@@ -440,4 +440,23 @@ class FinderTest extends Iterator\RealIteratorTestCase
$this->assertIterator(array(), $finder);
}
+ /**
+ * Searching in multiple locations involves AppendIterator which does an unnecessary rewind which leaves FilterIterator
+ * with inner FilesystemIterator in an ivalid state.
+ *
+ * @see https://bugs.php.net/bug.php?id=49104
+ */
+ public function testMultipleLocations()
+ {
+ $locations = array(
+ self::$tmpDir.'/',
+ self::$tmpDir.'/toto/',
+ );
+
+ // it is expected that there are test.py test.php in the tmpDir
+ $finder = new Finder();
+ $finder->in($locations)->depth('< 1')->name('test.php');
+
+ $this->assertEquals(1, count($finder));
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php
index f80e6a5..5f0625f 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php
@@ -165,12 +165,10 @@ class MockSplFileInfo extends \SplFileInfo
if (is_string($type)) {
switch ($type) {
case 'directory':
- $this->type = self::TYPE_DIRECTORY;
case 'd':
$this->type = self::TYPE_DIRECTORY;
break;
case 'file':
- $this->type = self::TYPE_FILE;
case 'f':
$this->type = self::TYPE_FILE;
break;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilterIteratorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilterIteratorTest.php
new file mode 100644
index 0000000..f42a62a
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Finder/Tests/Iterator/FilterIteratorTest.php
@@ -0,0 +1,50 @@
+
+ *
+ * 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;
+
+/**
+ * @author Alex Bogomazov
+ */
+class FilterIteratorTest extends RealIteratorTestCase
+{
+ public function testFilterFilesystemIterators()
+ {
+ $i = new \FilesystemIterator(sys_get_temp_dir().'/symfony2_finder');
+
+ // it is expected that there are test.py test.php in the tmpDir
+ $i = $this->getMockForAbstractClass('Symfony\Component\Finder\Iterator\FilterIterator', array($i));
+ $i->expects($this->any())
+ ->method('accept')
+ ->will($this->returnCallback(function () use ($i) {
+ return (bool) preg_match('/\.php/', (string) $i->current());
+ })
+ );
+
+ $c = 0;
+ foreach ($i as $item) {
+ $c++;
+ }
+
+ $this->assertEquals(1, $c);
+
+ $i->rewind();
+
+ $c = 0;
+ foreach ($i as $item) {
+ $c++;
+ }
+
+ // This would fail with \FilterIterator but works with Symfony\Component\Finder\Iterator\FilterIterator
+ // see https://bugs.php.net/bug.php?id=49104
+ $this->assertEquals(1, $c);
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/AbstractRendererEngine.php b/vendor/symfony/symfony/src/Symfony/Component/Form/AbstractRendererEngine.php
index 5d7416d..9e16b44 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/AbstractRendererEngine.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/AbstractRendererEngine.php
@@ -21,7 +21,7 @@ abstract class AbstractRendererEngine implements FormRendererEngineInterface
/**
* The variable in {@link FormView} used as cache key.
*/
- const CACHE_KEY_VAR = 'full_block_name';
+ const CACHE_KEY_VAR = 'cache_key';
/**
* @var array
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/Form/CHANGELOG.md
index 5d5a472..1e3a60f 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/CHANGELOG.md
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/CHANGELOG.md
@@ -152,12 +152,12 @@ CHANGELOG
* deprecated the options "data_timezone" and "user_timezone" in DateType, DateTimeType and TimeType
and renamed them to "model_timezone" and "view_timezone"
* fixed: TransformationFailedExceptions thrown in the model transformer are now caught by the form
- * added FormRegistry and ResolvedFormTypeInterface
+ * added FormRegistryInterface, ResolvedFormTypeInterface and ResolvedFormTypeFactoryInterface
* deprecated FormFactory methods
* `addType`
* `hasType`
* `getType`
- * [BC BREAK] FormFactory now expects a FormRegistryInterface as constructor argument
+ * [BC BREAK] FormFactory now expects a FormRegistryInterface and a ResolvedFormTypeFactoryInterface as constructor argument
* [BC BREAK] The method `createBuilder` in FormTypeInterface is not supported anymore for performance reasons
* [BC BREAK] Removed `setTypes` from FormBuilder
* deprecated AbstractType methods
@@ -175,3 +175,5 @@ CHANGELOG
* `isChoiceSelected`
* [BC BREAK] renamed method `renderBlock` in FormHelper to `block` and changed its signature
* made FormView properties public and deprecated their accessor methods
+ * made the normalized data of a form accessible in the template through the variable "form.vars.data"
+ * made the original data of a choice accessible in the template through the property "choice.data"
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php
index 4059757..fcccfdd 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Exception\InvalidConfigurationException;
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
@@ -20,7 +20,10 @@ use Symfony\Component\Form\Extension\Core\View\ChoiceView;
* A choice list for choices of arbitrary data types.
*
* Choices and labels are passed in two arrays. The indices of the choices
- * and the labels should match.
+ * and the labels should match. Choices may also be given as hierarchy of
+ * unlimited depth by creating nested arrays. The title of the sub-hierarchy
+ * can be stored in the array key pointing to the nested array. The topmost
+ * level of the hierarchy may also be a \Traversable.
*
*
* $choices = array(true, false);
@@ -66,17 +69,24 @@ class ChoiceList implements ChoiceListInterface
* Creates a new choice list.
*
* @param array|\Traversable $choices The array of choices. Choices may also be given
- * as hierarchy of unlimited depth. Hierarchies are
- * created by creating nested arrays. The title of
- * the sub-hierarchy can be stored in the array
- * key pointing to the nested array.
+ * as hierarchy of unlimited depth. Hierarchies are
+ * created by creating nested arrays. The title of
+ * the sub-hierarchy can be stored in the array
+ * key pointing to the nested array. The topmost
+ * level of the hierarchy may also be a \Traversable.
* @param array $labels The array of labels. The structure of this array
- * should match the structure of $choices.
+ * should match the structure of $choices.
* @param array $preferredChoices A flat array of choices that should be
- * presented to the user with priority.
+ * presented to the user with priority.
+ *
+ * @throws UnexpectedTypeException If the choices are not an array or \Traversable.
*/
public function __construct($choices, array $labels, array $preferredChoices = array())
{
+ if (!is_array($choices) && !$choices instanceof \Traversable) {
+ throw new UnexpectedTypeException($choices, 'array or \Traversable');
+ }
+
$this->initialize($choices, $labels, $preferredChoices);
}
@@ -236,22 +246,25 @@ class ChoiceList implements ChoiceListInterface
/**
* Recursively adds the given choices to the list.
*
- * @param array $bucketForPreferred The bucket where to store the preferred
- * view objects.
- * @param array $bucketForRemaining The bucket where to store the
- * non-preferred view objects.
- * @param array $choices The list of choices.
- * @param array $labels The labels corresponding to the choices.
- * @param array $preferredChoices The preferred choices.
+ * @param array $bucketForPreferred The bucket where to store the preferred
+ * view objects.
+ * @param array $bucketForRemaining The bucket where to store the
+ * non-preferred view objects.
+ * @param array|\Traversable $choices The list of choices.
+ * @param array $labels The labels corresponding to the choices.
+ * @param array $preferredChoices The preferred choices.
*
- * @throws UnexpectedTypeException If the structure of the $labels array
- * does not match the structure of the
- * $choices array.
+ * @throws \InvalidArgumentException If the structures of the choices and labels array do not match.
+ * @throws InvalidConfigurationException If no valid value or index could be created for a choice.
*/
- protected function addChoices(&$bucketForPreferred, &$bucketForRemaining, array $choices, array $labels, array $preferredChoices)
+ protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, array $labels, array $preferredChoices)
{
// Add choices to the nested buckets
foreach ($choices as $group => $choice) {
+ if (!isset($labels[$group])) {
+ throw new \InvalidArgumentException('The structures of the choices and labels array do not match.');
+ }
+
if (is_array($choice)) {
// Don't do the work if the array is empty
if (count($choice) > 0) {
@@ -281,14 +294,16 @@ class ChoiceList implements ChoiceListInterface
*
* @param string $group The name of the group.
* @param array $bucketForPreferred The bucket where to store the preferred
- * view objects.
- * @param array $bucketForRemaining The bucket where to store the
- * non-preferred view objects.
- * @param array $choices The list of choices in the group.
- * @param array $labels The labels corresponding to the choices in the group.
- * @param array $preferredChoices The preferred choices.
+ * view objects.
+ * @param array $bucketForRemaining The bucket where to store the
+ * non-preferred view objects.
+ * @param array $choices The list of choices in the group.
+ * @param array $labels The labels corresponding to the choices in the group.
+ * @param array $preferredChoices The preferred choices.
+ *
+ * @throws InvalidConfigurationException If no valid value or index could be created for a choice.
*/
- protected function addChoiceGroup($group, &$bucketForPreferred, &$bucketForRemaining, array $choices, array $labels, array $preferredChoices)
+ protected function addChoiceGroup($group, array &$bucketForPreferred, array &$bucketForRemaining, array $choices, array $labels, array $preferredChoices)
{
// If this is a choice group, create a new level in the choice
// key hierarchy
@@ -325,11 +340,11 @@ class ChoiceList implements ChoiceListInterface
*
* @throws InvalidConfigurationException If no valid value or index could be created.
*/
- protected function addChoice(&$bucketForPreferred, &$bucketForRemaining, $choice, $label, array $preferredChoices)
+ protected function addChoice(array &$bucketForPreferred, array &$bucketForRemaining, $choice, $label, array $preferredChoices)
{
$index = $this->createIndex($choice);
- if ('' === $index || null === $index || !FormConfig::isValidName((string) $index)) {
+ if ('' === $index || null === $index || !FormConfigBuilder::isValidName((string) $index)) {
throw new InvalidConfigurationException('The index "' . $index . '" created by the choice list is invalid. It should be a valid, non-empty Form name.');
}
@@ -339,7 +354,7 @@ class ChoiceList implements ChoiceListInterface
throw new InvalidConfigurationException('The value created by the choice list is of type "' . gettype($value) . '", but should be a string.');
}
- $view = new ChoiceView($value, $label);
+ $view = new ChoiceView($choice, $value, $label);
$this->choices[$index] = $this->fixChoice($choice);
$this->values[$index] = $value;
@@ -481,7 +496,7 @@ class ChoiceList implements ChoiceListInterface
/**
* Fixes the data type of the given choices to avoid comparison problems.
*
- * @param array $choice The choices.
+ * @param array $choices The choices.
*
* @return array The fixed choices.
*
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php
index 2e08081..eeb6b64 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php
@@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\ChoiceList;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Form\Exception\StringCastException;
-use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Exception\InvalidPropertyException;
/**
@@ -57,11 +56,12 @@ class ObjectChoiceList extends ChoiceList
/**
* Creates a new object choice list.
*
- * @param array $choices The array of choices. Choices may also be given
- * as hierarchy of unlimited depth. Hierarchies are
- * created by creating nested arrays. The title of
- * the sub-hierarchy can be stored in the array
- * key pointing to the nested array.
+ * @param array|\Traversable $choices The array of choices. Choices may also be given
+ * as hierarchy of unlimited depth by creating nested
+ * arrays. The title of the sub-hierarchy can be
+ * stored in the array key pointing to the nested
+ * array. The topmost level of the hierarchy may also
+ * be a \Traversable.
* @param string $labelPath A property path pointing to the property used
* for the choice labels. The value is obtained
* by calling the getter on the object. If the
@@ -78,9 +78,9 @@ class ObjectChoiceList extends ChoiceList
*/
public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null)
{
- $this->labelPath = $labelPath ? new PropertyPath($labelPath) : null;
- $this->groupPath = $groupPath ? new PropertyPath($groupPath) : null;
- $this->valuePath = $valuePath ? new PropertyPath($valuePath) : null;
+ $this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null;
+ $this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null;
+ $this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
parent::__construct($choices, array(), $preferredChoices);
}
@@ -93,19 +93,18 @@ class ObjectChoiceList extends ChoiceList
* @param array|\Traversable $choices The choices to write into the list.
* @param array $labels Ignored.
* @param array $preferredChoices The choices to display with priority.
+ *
+ * @throws \InvalidArgumentException When passing a hierarchy of choices and using
+ * the "groupPath" option at the same time.
*/
protected function initialize($choices, array $labels, array $preferredChoices)
{
- if (!is_array($choices) && !$choices instanceof \Traversable) {
- throw new UnexpectedTypeException($choices, 'array or \Traversable');
- }
-
if (null !== $this->groupPath) {
$groupedChoices = array();
foreach ($choices as $i => $choice) {
if (is_array($choice)) {
- throw new \InvalidArgumentException('You should pass a plain object array (without groups, $code, $previous) when using the "groupPath" option');
+ throw new \InvalidArgumentException('You should pass a plain object array (without groups) when using the "groupPath" option.');
}
try {
@@ -142,10 +141,10 @@ class ObjectChoiceList extends ChoiceList
*
* If a property path for the value was given at object creation,
* the getter behind that path is now called to obtain a new value.
- *
* Otherwise a new integer is generated.
*
* @param mixed $choice The choice to create a value for
+ *
* @return integer|string A unique value without character limitations.
*/
protected function createValue($choice)
@@ -160,7 +159,7 @@ class ObjectChoiceList extends ChoiceList
private function extractLabels($choices, array &$labels)
{
foreach ($choices as $i => $choice) {
- if (is_array($choice) || $choice instanceof \Traversable) {
+ if (is_array($choice)) {
$labels[$i] = array();
$this->extractLabels($choice, $labels[$i]);
} elseif ($this->labelPath) {
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php
index 3e76900..914dbe5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/ChoiceList/SimpleChoiceList.php
@@ -11,14 +11,14 @@
namespace Symfony\Component\Form\Extension\Core\ChoiceList;
-use Symfony\Component\Form\Exception\UnexpectedTypeException;
-
/**
* A choice list for choices of type string or integer.
*
* Choices and their associated labels can be passed in a single array. Since
* choices are passed as array keys, only strings or integer choices are
- * allowed.
+ * allowed. Choices may also be given as hierarchy of unlimited depth by
+ * creating nested arrays. The title of the sub-hierarchy can be stored in the
+ * array key pointing to the nested array.
*
*
* $choiceList = new SimpleChoiceList(array(
@@ -35,13 +35,12 @@ class SimpleChoiceList extends ChoiceList
* Creates a new simple choice list.
*
* @param array $choices The array of choices with the choices as keys and
- * the labels as values. Choices may also be given
- * as hierarchy of unlimited depth. Hierarchies are
- * created by creating nested arrays. The title of
- * the sub-hierarchy is stored in the array
- * key pointing to the nested array.
+ * the labels as values. Choices may also be given
+ * as hierarchy of unlimited depth by creating nested
+ * arrays. The title of the sub-hierarchy is stored
+ * in the array key pointing to the nested array.
* @param array $preferredChoices A flat array of choices that should be
- * presented to the user with priority.
+ * presented to the user with priority.
*/
public function __construct(array $choices, array $preferredChoices = array())
{
@@ -79,17 +78,15 @@ class SimpleChoiceList extends ChoiceList
* Takes care of splitting the single $choices array passed in the
* constructor into choices and labels.
*
- * @param array $bucketForPreferred
- * @param array $bucketForRemaining
- * @param array $choices
- * @param array $labels
- * @param array $preferredChoices
- *
- * @throws UnexpectedTypeException
- *
- * @see parent::addChoices
+ * @param array $bucketForPreferred The bucket where to store the preferred
+ * view objects.
+ * @param array $bucketForRemaining The bucket where to store the
+ * non-preferred view objects.
+ * @param array|\Traversable $choices The list of choices.
+ * @param array $labels Ignored.
+ * @param array $preferredChoices The preferred choices.
*/
- protected function addChoices(&$bucketForPreferred, &$bucketForRemaining, array $choices, array $labels, array $preferredChoices)
+ protected function addChoices(array &$bucketForPreferred, array &$bucketForRemaining, $choices, array $labels, array $preferredChoices)
{
// Add choices to the nested buckets
foreach ($choices as $choice => $label) {
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/CoreExtension.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/CoreExtension.php
index e57a5b2..f0f0d18 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/CoreExtension.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/CoreExtension.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Form\Extension\Core;
-use Symfony\Component\Form\Extension\Core\Type;
use Symfony\Component\Form\AbstractExtension;
/**
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
index 724830e..9dfa8af 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/Type/FormType.php
@@ -17,7 +17,6 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormFactoryInterface;
use Symfony\Component\Form\FormView;
-use Symfony\Component\Form\Extension\Core\EventListener\BindRequestListener;
use Symfony\Component\Form\Extension\Core\EventListener\TrimListener;
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
use Symfony\Component\Form\Exception\FormException;
@@ -45,7 +44,6 @@ class FormType extends AbstractType
->setData(isset($options['data']) ? $options['data'] : null)
->setDataLocked(isset($options['data']))
->setDataMapper($options['compound'] ? new PropertyPathMapper() : null)
- ->addEventSubscriber(new BindRequestListener())
;
if ($options['trim']) {
@@ -71,11 +69,11 @@ class FormType extends AbstractType
if ('' !== ($parentFullName = $view->parent->vars['full_name'])) {
$id = sprintf('%s_%s', $view->parent->vars['id'], $name);
$fullName = sprintf('%s[%s]', $parentFullName, $name);
- $fullBlockName = sprintf('%s_%s', $view->parent->vars['full_block_name'], $blockName);
+ $uniqueBlockPrefix = sprintf('%s_%s', $view->parent->vars['unique_block_prefix'], $blockName);
} else {
$id = $name;
$fullName = $name;
- $fullBlockName = '_' . $blockName;
+ $uniqueBlockPrefix = '_' . $blockName;
}
// Complex fields are read-only if they themselves or their parents are.
@@ -89,7 +87,7 @@ class FormType extends AbstractType
} else {
$id = $name;
$fullName = $name;
- $fullBlockName = '_' . $blockName;
+ $uniqueBlockPrefix = '_' . $blockName;
// Strip leading underscores and digits. These are allowed in
// form names, but not in HTML4 ID attributes.
@@ -97,37 +95,46 @@ class FormType extends AbstractType
$id = ltrim($id, '_0123456789');
}
- $types = array();
+ $blockPrefixes = array();
for ($type = $form->getConfig()->getType(); null !== $type; $type = $type->getParent()) {
- array_unshift($types, $type->getName());
+ array_unshift($blockPrefixes, $type->getName());
}
+ $blockPrefixes[] = $uniqueBlockPrefix;
if (!$translationDomain) {
$translationDomain = 'messages';
}
$view->vars = array_replace($view->vars, array(
- 'form' => $view,
- 'id' => $id,
- 'name' => $name,
- 'full_name' => $fullName,
- 'full_block_name' => $fullBlockName,
- 'read_only' => $readOnly,
- 'errors' => $form->getErrors(),
- 'valid' => $form->isBound() ? $form->isValid() : true,
- 'value' => $form->getViewData(),
- 'disabled' => $form->isDisabled(),
- 'required' => $form->isRequired(),
- 'max_length' => $options['max_length'],
- 'pattern' => $options['pattern'],
- 'size' => null,
- 'label' => $options['label'],
- 'multipart' => false,
- 'attr' => $options['attr'],
- 'label_attr' => $options['label_attr'],
- 'compound' => $form->getConfig()->getCompound(),
- 'types' => $types,
- 'translation_domain' => $translationDomain,
+ 'form' => $view,
+ 'id' => $id,
+ 'name' => $name,
+ 'full_name' => $fullName,
+ 'read_only' => $readOnly,
+ 'errors' => $form->getErrors(),
+ 'valid' => $form->isBound() ? $form->isValid() : true,
+ 'value' => $form->getViewData(),
+ 'data' => $form->getNormData(),
+ 'disabled' => $form->isDisabled(),
+ 'required' => $form->isRequired(),
+ 'max_length' => $options['max_length'],
+ 'pattern' => $options['pattern'],
+ 'size' => null,
+ 'label' => $options['label'],
+ 'multipart' => false,
+ 'attr' => $options['attr'],
+ 'label_attr' => $options['label_attr'],
+ 'compound' => $form->getConfig()->getCompound(),
+ 'block_prefixes' => $blockPrefixes,
+ 'unique_block_prefix' => $uniqueBlockPrefix,
+ 'translation_domain' => $translationDomain,
+ // Using the block name here speeds up performance in collection
+ // forms, where each entry has the same full block name.
+ // Including the type is important too, because if rows of a
+ // collection form have different types (dynamically), they should
+ // be rendered differently.
+ // https://github.com/symfony/symfony/issues/5038
+ 'cache_key' => $uniqueBlockPrefix . '_' . $form->getConfig()->getType()->getName(),
));
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php
index 0f7d176..5b348ea 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/View/ChoiceView.php
@@ -18,6 +18,13 @@ namespace Symfony\Component\Form\Extension\Core\View;
*/
class ChoiceView
{
+ /**
+ * The original choice value.
+ *
+ * @var mixed
+ */
+ public $data;
+
/**
* The view representation of the choice.
*
@@ -35,11 +42,13 @@ class ChoiceView
/**
* Creates a new ChoiceView.
*
+ * @param mixed $data The original choice.
* @param string $value The view representation of the choice.
* @param string $label The label displayed to humans.
*/
- public function __construct($value, $label)
+ public function __construct($data, $value, $label)
{
+ $this->data = $data;
$this->value = $value;
$this->label = $label;
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php
index 5d25007..bf0c873 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php
@@ -56,8 +56,9 @@ class FormTypeCsrfExtension extends AbstractTypeExtension
/**
* Adds a CSRF field to the root form view.
*
- * @param FormView $view The form view
- * @param FormInterface $form The form
+ * @param FormView $view The form view
+ * @param FormInterface $form The form
+ * @param array $options The options
*/
public function finishView(FormView $view, FormInterface $form, array $options)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/BindRequestListener.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php
similarity index 97%
rename from vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/BindRequestListener.php
rename to vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php
index 868a5ae..1c019fc 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Core/EventListener/BindRequestListener.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/EventListener/BindRequestListener.php
@@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Form\Extension\Core\EventListener;
+namespace Symfony\Component\Form\Extension\HttpFoundation\EventListener;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php
new file mode 100644
index 0000000..3c440a6
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationExtension.php
@@ -0,0 +1,29 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Form\Extension\HttpFoundation;
+
+use Symfony\Component\Form\AbstractExtension;
+
+/**
+ * Integrates the HttpFoundation component with the Form library.
+ *
+ * @author Bernhard Schussek
+ */
+class HttpFoundationExtension extends AbstractExtension
+{
+ protected function loadTypes()
+ {
+ return array(
+ new Type\FormTypeHttpFoundationExtension(),
+ );
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php
new file mode 100644
index 0000000..27a1831
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/HttpFoundation/Type/FormTypeHttpFoundationExtension.php
@@ -0,0 +1,50 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Form\Extension\HttpFoundation\Type;
+
+use Symfony\Component\Form\AbstractTypeExtension;
+use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
+use Symfony\Component\Form\FormBuilderInterface;
+use Symfony\Component\OptionsResolver\Options;
+use Symfony\Component\OptionsResolver\OptionsResolverInterface;
+
+/**
+ * @author Bernhard Schussek
+ */
+class FormTypeHttpFoundationExtension extends AbstractTypeExtension
+{
+ /**
+ * @var BindRequestListener
+ */
+ private $listener;
+
+ public function __construct()
+ {
+ $this->listener = new BindRequestListener();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options)
+ {
+ $builder->addEventSubscriber($this->listener);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getExtendedType()
+ {
+ return 'form';
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
index 9b755e1..6aa2da1 100755
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php
@@ -125,10 +125,10 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
return new TypeGuess('country', array(), Guess::HIGH_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Date':
- return new TypeGuess('date', array('type' => 'string'), Guess::HIGH_CONFIDENCE);
+ return new TypeGuess('date', array('input' => 'string'), Guess::HIGH_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\DateTime':
- return new TypeGuess('datetime', array('type' => 'string'), Guess::HIGH_CONFIDENCE);
+ return new TypeGuess('datetime', array('input' => 'string'), Guess::HIGH_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Email':
return new TypeGuess('email', array(), Guess::HIGH_CONFIDENCE);
@@ -144,7 +144,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
return new TypeGuess('locale', array(), Guess::HIGH_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Time':
- return new TypeGuess('time', array('type' => 'string'), Guess::HIGH_CONFIDENCE);
+ return new TypeGuess('time', array('input' => 'string'), Guess::HIGH_CONFIDENCE);
case 'Symfony\Component\Validator\Constraints\Url':
return new TypeGuess('url', array(), Guess::HIGH_CONFIDENCE);
@@ -157,7 +157,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Regex':
return new TypeGuess('text', array(), Guess::LOW_CONFIDENCE);
- case 'Symfony\Component\Validator\Constraints\Size':
case 'Symfony\Component\Validator\Constraints\Min':
case 'Symfony\Component\Validator\Constraints\Max':
return new TypeGuess('number', array(), Guess::LOW_CONFIDENCE);
@@ -220,9 +219,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Max':
return new ValueGuess(strlen((string) $constraint->limit), Guess::LOW_CONFIDENCE);
-
- case 'Symfony\Component\Validator\Constraints\Size':
- return new ValueGuess(strlen((string) $constraint->max), Guess::LOW_CONFIDENCE);
}
return null;
@@ -252,9 +248,6 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
case 'Symfony\Component\Validator\Constraints\Min':
return new ValueGuess(sprintf('.{%s,}', strlen((string) $constraint->limit)), Guess::LOW_CONFIDENCE);
- case 'Symfony\Component\Validator\Constraints\Size':
- return new ValueGuess(sprintf('.{%s,%s}', strlen((string) $constraint->min), strlen((string) $constraint->max)), Guess::LOW_CONFIDENCE);
-
case 'Symfony\Component\Validator\Constraints\Type':
if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) {
return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE);
@@ -269,12 +262,12 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface
* Iterates over the constraints of a property, executes a constraints on
* them and returns the best guess
*
- * @param string $class The class to read the constraints from
- * @param string $property The property for which to find constraints
- * @param \Closure $closure The closure that returns a guess
- * for a given constraint
- * @param mixed $default The default value assumed if no other value
- * can be guessed.
+ * @param string $class The class to read the constraints from
+ * @param string $property The property for which to find constraints
+ * @param \Closure $closure The closure that returns a guess
+ * for a given constraint
+ * @param mixed $defaultValue The default value assumed if no other value
+ * can be guessed.
*
* @return Guess The guessed value with the highest confidence
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php
index 1cb5609..e9cf205 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Form.php
@@ -146,10 +146,6 @@ class Form implements \IteratorAggregate, FormInterface
*/
public function __construct(FormConfigInterface $config)
{
- if (!$config instanceof ImmutableFormConfig) {
- $config = new ImmutableFormConfig($config);
- }
-
// Compound forms always need a data mapper, otherwise calls to
// `setData` and `add` will not lead to the correct population of
// the child forms.
@@ -170,7 +166,7 @@ class Form implements \IteratorAggregate, FormInterface
/**
* Returns the configuration of the form.
*
- * @return ImmutableFormConfig The form's immutable configuration.
+ * @return FormConfigInterface The form's configuration.
*/
public function getConfig()
{
@@ -372,13 +368,16 @@ class Form implements \IteratorAggregate, FormInterface
}
$this->lockSetData = true;
+ $dispatcher = $this->config->getEventDispatcher();
// Hook to change content of the data
- $event = new FormEvent($this, $modelData);
- $this->config->getEventDispatcher()->dispatch(FormEvents::PRE_SET_DATA, $event);
- // BC until 2.3
- $this->config->getEventDispatcher()->dispatch(FormEvents::SET_DATA, $event);
- $modelData = $event->getData();
+ if ($dispatcher->hasListeners(FormEvents::PRE_SET_DATA) || $dispatcher->hasListeners(FormEvents::SET_DATA)) {
+ $event = new FormEvent($this, $modelData);
+ $dispatcher->dispatch(FormEvents::PRE_SET_DATA, $event);
+ // BC until 2.3
+ $dispatcher->dispatch(FormEvents::SET_DATA, $event);
+ $modelData = $event->getData();
+ }
// Treat data as strings unless a value transformer exists
if (!$this->config->getViewTransformers() && !$this->config->getModelTransformers() && is_scalar($modelData)) {
@@ -432,8 +431,10 @@ class Form implements \IteratorAggregate, FormInterface
$this->config->getDataMapper()->mapDataToForms($viewData, $this->children);
}
- $event = new FormEvent($this, $modelData);
- $this->config->getEventDispatcher()->dispatch(FormEvents::POST_SET_DATA, $event);
+ if ($dispatcher->hasListeners(FormEvents::POST_SET_DATA)) {
+ $event = new FormEvent($this, $modelData);
+ $dispatcher->dispatch(FormEvents::POST_SET_DATA, $event);
+ }
return $this;
}
@@ -526,6 +527,13 @@ class Form implements \IteratorAggregate, FormInterface
return $this;
}
+ // The data must be initialized if it was not initialized yet.
+ // This is necessary to guarantee that the *_SET_DATA listeners
+ // are always invoked before bind() takes place.
+ if (!$this->initialized) {
+ $this->setData($this->config->getData());
+ }
+
// Don't convert NULL to a string here in order to determine later
// whether an empty value has been submitted or whether no value has
// been submitted at all. This is important for processing checkboxes
@@ -542,13 +550,16 @@ class Form implements \IteratorAggregate, FormInterface
$normData = null;
$extraData = array();
$synchronized = false;
+ $dispatcher = $this->config->getEventDispatcher();
// Hook to change content of the data bound by the browser
- $event = new FormEvent($this, $submittedData);
- $this->config->getEventDispatcher()->dispatch(FormEvents::PRE_BIND, $event);
- // BC until 2.3
- $this->config->getEventDispatcher()->dispatch(FormEvents::BIND_CLIENT_DATA, $event);
- $submittedData = $event->getData();
+ if ($dispatcher->hasListeners(FormEvents::PRE_BIND) || $dispatcher->hasListeners(FormEvents::BIND_CLIENT_DATA)) {
+ $event = new FormEvent($this, $submittedData);
+ $dispatcher->dispatch(FormEvents::PRE_BIND, $event);
+ // BC until 2.3
+ $dispatcher->dispatch(FormEvents::BIND_CLIENT_DATA, $event);
+ $submittedData = $event->getData();
+ }
// By default, the submitted data is also the data in view format
$viewData = $submittedData;
@@ -610,11 +621,13 @@ class Form implements \IteratorAggregate, FormInterface
// Hook to change content of the data into the normalized
// representation
- $event = new FormEvent($this, $normData);
- $this->config->getEventDispatcher()->dispatch(FormEvents::BIND, $event);
- // BC until 2.3
- $this->config->getEventDispatcher()->dispatch(FormEvents::BIND_NORM_DATA, $event);
- $normData = $event->getData();
+ if ($dispatcher->hasListeners(FormEvents::BIND) || $dispatcher->hasListeners(FormEvents::BIND_NORM_DATA)) {
+ $event = new FormEvent($this, $normData);
+ $dispatcher->dispatch(FormEvents::BIND, $event);
+ // BC until 2.3
+ $dispatcher->dispatch(FormEvents::BIND_NORM_DATA, $event);
+ $normData = $event->getData();
+ }
// Synchronize representations - must not change the content!
$modelData = $this->normToModel($normData);
@@ -630,10 +643,11 @@ class Form implements \IteratorAggregate, FormInterface
$this->viewData = $viewData;
$this->extraData = $extraData;
$this->synchronized = $synchronized;
- $this->initialized = true;
- $event = new FormEvent($this, $viewData);
- $this->config->getEventDispatcher()->dispatch(FormEvents::POST_BIND, $event);
+ if ($dispatcher->hasListeners(FormEvents::POST_BIND)) {
+ $event = new FormEvent($this, $viewData);
+ $dispatcher->dispatch(FormEvents::POST_BIND, $event);
+ }
foreach ($this->config->getValidators() as $validator) {
$validator->validate($this);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php
index 4abec18..e89cdfd 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php
@@ -20,7 +20,7 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
*
* @author Bernhard Schussek
*/
-class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderInterface
+class FormBuilder extends FormConfigBuilder implements \IteratorAggregate, FormBuilderInterface
{
/**
* The form factory.
@@ -56,6 +56,7 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
* @param string $dataClass
* @param EventDispatcherInterface $dispatcher
* @param FormFactoryInterface $factory
+ * @param array $options
*/
public function __construct($name, $dataClass, EventDispatcherInterface $dispatcher, FormFactoryInterface $factory, array $options = array())
{
@@ -77,6 +78,10 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
*/
public function add($child, $type = null, array $options = array())
{
+ if ($this->locked) {
+ throw new FormException('The form builder cannot be modified anymore.');
+ }
+
if ($child instanceof self) {
$child->setParent($this);
$this->children[$child->getName()] = $child;
@@ -110,6 +115,10 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
*/
public function create($name, $type = null, array $options = array())
{
+ if ($this->locked) {
+ throw new FormException('The form builder cannot be modified anymore.');
+ }
+
if (null === $type && null === $this->getDataClass()) {
$type = 'text';
}
@@ -142,6 +151,10 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
*/
public function remove($name)
{
+ if ($this->locked) {
+ throw new FormException('The form builder cannot be modified anymore.');
+ }
+
unset($this->unresolvedChildren[$name]);
if (array_key_exists($name, $this->children)) {
@@ -195,7 +208,7 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
{
$this->resolveChildren();
- $form = new Form($this);
+ $form = new Form($this->getFormConfig());
foreach ($this->children as $child) {
$form->add($child->getForm());
@@ -217,6 +230,10 @@ class FormBuilder extends FormConfig implements \IteratorAggregate, FormBuilderI
*/
public function setParent(FormBuilderInterface $parent = null)
{
+ if ($this->locked) {
+ throw new FormException('The form builder cannot be modified anymore.');
+ }
+
$this->parent = $parent;
return $this;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilderInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilderInterface.php
index bc8eee1..034a65a 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilderInterface.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormBuilderInterface.php
@@ -14,7 +14,7 @@ namespace Symfony\Component\Form;
/**
* @author Bernhard Schussek
*/
-interface FormBuilderInterface extends FormConfigEditorInterface, \Traversable, \Countable
+interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface
{
/**
* Adds a new field to this group. A field must have a unique name within
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfig.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilder.php
similarity index 76%
rename from vendor/symfony/symfony/src/Symfony/Component/Form/FormConfig.php
rename to vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilder.php
index af68a13..81906fe 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfig.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilder.php
@@ -11,18 +11,25 @@
namespace Symfony\Component\Form;
+use Symfony\Component\Form\Exception\FormException;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\EventDispatcher\ImmutableEventDispatcher;
/**
* A basic form configuration.
*
* @author Bernhard Schussek
*/
-class FormConfig implements FormConfigEditorInterface
+class FormConfigBuilder implements FormConfigBuilderInterface
{
+ /**
+ * @var Boolean
+ */
+ protected $locked = false;
+
/**
* @var EventDispatcherInterface
*/
@@ -161,6 +168,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function addEventListener($eventName, $listener, $priority = 0)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->dispatcher->addListener($eventName, $listener, $priority);
return $this;
@@ -171,6 +182,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function addEventSubscriber(EventSubscriberInterface $subscriber)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->dispatcher->addSubscriber($subscriber);
return $this;
@@ -181,6 +196,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function addValidator(FormValidatorInterface $validator)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->validators[] = $validator;
return $this;
@@ -191,6 +210,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function addViewTransformer(DataTransformerInterface $viewTransformer, $forcePrepend = false)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
if ($forcePrepend) {
array_unshift($this->viewTransformers, $viewTransformer);
} else {
@@ -205,6 +228,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function resetViewTransformers()
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->viewTransformers = array();
return $this;
@@ -215,13 +242,17 @@ class FormConfig implements FormConfigEditorInterface
*
* @param DataTransformerInterface $viewTransformer
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link addViewTransformer()} instead.
*/
public function appendClientTransformer(DataTransformerInterface $viewTransformer)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->addViewTransformer($viewTransformer);
}
@@ -230,25 +261,33 @@ class FormConfig implements FormConfigEditorInterface
*
* @param DataTransformerInterface $viewTransformer
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
public function prependClientTransformer(DataTransformerInterface $viewTransformer)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->addViewTransformer($viewTransformer, true);
}
/**
* Alias of {@link resetViewTransformers()}.
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link resetViewTransformers()} instead.
*/
public function resetClientTransformers()
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->resetViewTransformers();
}
@@ -257,6 +296,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function addModelTransformer(DataTransformerInterface $modelTransformer, $forceAppend = false)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
if ($forceAppend) {
$this->modelTransformers[] = $modelTransformer;
} else {
@@ -271,6 +314,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function resetModelTransformers()
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->modelTransformers = array();
return $this;
@@ -281,12 +328,16 @@ class FormConfig implements FormConfigEditorInterface
*
* @param DataTransformerInterface $modelTransformer
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
public function appendNormTransformer(DataTransformerInterface $modelTransformer)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->addModelTransformer($modelTransformer, true);
}
@@ -295,26 +346,34 @@ class FormConfig implements FormConfigEditorInterface
*
* @param DataTransformerInterface $modelTransformer
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link addModelTransformer()} instead.
*/
public function prependNormTransformer(DataTransformerInterface $modelTransformer)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->addModelTransformer($modelTransformer);
}
/**
* Alias of {@link resetModelTransformers()}.
*
- * @return self The configuration object.
+ * @return FormConfigBuilder The configuration object.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link resetModelTransformers()} instead.
*/
public function resetNormTransformers()
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
return $this->resetModelTransformers();
}
@@ -549,6 +608,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setAttribute($name, $value)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->attributes[$name] = $value;
return $this;
@@ -559,6 +622,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setAttributes(array $attributes)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->attributes = $attributes;
return $this;
@@ -569,6 +636,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setDataMapper(DataMapperInterface $dataMapper = null)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->dataMapper = $dataMapper;
return $this;
@@ -579,6 +650,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setDisabled($disabled)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->disabled = (Boolean) $disabled;
return $this;
@@ -589,6 +664,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setEmptyData($emptyData)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->emptyData = $emptyData;
return $this;
@@ -599,6 +678,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setErrorBubbling($errorBubbling)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->errorBubbling = null === $errorBubbling ? null : (Boolean) $errorBubbling;
return $this;
@@ -609,6 +692,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setRequired($required)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->required = (Boolean) $required;
return $this;
@@ -619,6 +706,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setPropertyPath($propertyPath)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
if (null !== $propertyPath && !$propertyPath instanceof PropertyPath) {
$propertyPath = new PropertyPath($propertyPath);
}
@@ -633,6 +724,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setMapped($mapped)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->mapped = $mapped;
return $this;
@@ -643,6 +738,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setByReference($byReference)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->byReference = $byReference;
return $this;
@@ -653,6 +752,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setVirtual($virtual)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->virtual = $virtual;
return $this;
@@ -663,6 +766,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setCompound($compound)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->compound = $compound;
return $this;
@@ -673,6 +780,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setType(ResolvedFormTypeInterface $type)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->type = $type;
return $this;
@@ -683,6 +794,10 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setData($data)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->data = $data;
return $this;
@@ -693,11 +808,31 @@ class FormConfig implements FormConfigEditorInterface
*/
public function setDataLocked($locked)
{
+ if ($this->locked) {
+ throw new FormException('The config builder cannot be modified anymore.');
+ }
+
$this->dataLocked = $locked;
return $this;
}
+ /**
+ * {@inheritdoc}
+ */
+ public function getFormConfig()
+ {
+ // This method should be idempotent, so clone the builder
+ $config = clone $this;
+ $config->locked = true;
+
+ if (!$config->dispatcher instanceof ImmutableEventDispatcher) {
+ $config->dispatcher = new ImmutableEventDispatcher($config->dispatcher);
+ }
+
+ return $config;
+ }
+
/**
* Validates whether the given variable is a valid form name.
*
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigEditorInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilderInterface.php
similarity index 97%
rename from vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigEditorInterface.php
rename to vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilderInterface.php
index b84dbb0..988abb4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigEditorInterface.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormConfigBuilderInterface.php
@@ -16,7 +16,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* @author Bernhard Schussek
*/
-interface FormConfigEditorInterface extends FormConfigInterface
+interface FormConfigBuilderInterface extends FormConfigInterface
{
/**
* Adds an event listener to an event on this form.
@@ -240,4 +240,11 @@ interface FormConfigEditorInterface extends FormConfigInterface
* @return self The configuration object.
*/
public function setDataLocked($locked);
+
+ /**
+ * Builds and returns the form configuration.
+ *
+ * @return FormConfigInterface
+ */
+ public function getFormConfig();
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php
index a925b1a..4ecbfb4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormFactory.php
@@ -23,9 +23,15 @@ class FormFactory implements FormFactoryInterface
*/
private $registry;
- public function __construct(FormRegistryInterface $registry)
+ /**
+ * @var ResolvedFormTypeFactoryInterface
+ */
+ private $resolvedTypeFactory;
+
+ public function __construct(FormRegistryInterface $registry, ResolvedFormTypeFactoryInterface $resolvedTypeFactory)
{
$this->registry = $registry;
+ $this->resolvedTypeFactory = $resolvedTypeFactory;
}
/**
@@ -73,14 +79,20 @@ class FormFactory implements FormFactoryInterface
$options['data'] = $data;
}
- if ($type instanceof ResolvedFormTypeInterface) {
- $this->registry->addType($type);
- } elseif ($type instanceof FormTypeInterface) {
- $type = $this->registry->resolveType($type);
- $this->registry->addType($type);
+ if ($type instanceof FormTypeInterface) {
+ // An unresolved type instance was passed. Type extensions
+ // are not supported for these. If you want to use type
+ // extensions, you should create form extensions or register
+ // your type in the Dependency Injection configuration instead.
+ $parentType = $type->getParent();
+ $type = $this->resolvedTypeFactory->createResolvedType(
+ $type,
+ array(),
+ $parentType ? $this->registry->getType($parentType) : null
+ );
} elseif (is_string($type)) {
$type = $this->registry->getType($type);
- } else {
+ } elseif (!$type instanceof ResolvedFormTypeInterface) {
throw new UnexpectedTypeException($type, 'string, Symfony\Component\Form\ResolvedFormTypeInterface or Symfony\Component\Form\FormTypeInterface');
}
@@ -152,12 +164,18 @@ class FormFactory implements FormFactoryInterface
* @param FormTypeInterface $type The type
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
- * {@link FormRegistryInterface::resolveType()} and
- * {@link FormRegistryInterface::addType()} instead.
+ * form extensions or type registration in the Dependency
+ * Injection Container instead.
*/
public function addType(FormTypeInterface $type)
{
- $this->registry->addType($this->registry->resolveType($type));
+ $parentType = $type->getParent();
+
+ $this->registry->addType($this->resolvedTypeFactory->createResolvedType(
+ $type,
+ array(),
+ $parentType ? $this->registry->getType($parentType) : null
+ ));
}
/**
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php
index 12c6101..14f5cb3 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistry.php
@@ -37,14 +37,20 @@ class FormRegistry implements FormRegistryInterface
*/
private $guesser;
+ /**
+ * @var ResolvedFormTypeFactoryInterface
+ */
+ private $resolvedTypeFactory;
+
/**
* Constructor.
*
- * @param array $extensions An array of FormExtensionInterface
+ * @param array $extensions An array of FormExtensionInterface
+ * @param ResolvedFormTypeFactoryInterface $resolvedTypeFactory The factory for resolved form types.
*
* @throws UnexpectedTypeException if any extension does not implement FormExtensionInterface
*/
- public function __construct(array $extensions)
+ public function __construct(array $extensions, ResolvedFormTypeFactoryInterface $resolvedTypeFactory)
{
foreach ($extensions as $extension) {
if (!$extension instanceof FormExtensionInterface) {
@@ -53,26 +59,7 @@ class FormRegistry implements FormRegistryInterface
}
$this->extensions = $extensions;
- }
-
- /**
- * {@inheritdoc}
- */
- public function resolveType(FormTypeInterface $type)
- {
- $typeExtensions = array();
-
- foreach ($this->extensions as $extension) {
- /* @var FormExtensionInterface $extension */
- $typeExtensions = array_merge(
- $typeExtensions,
- $extension->getTypeExtensions($type->getName())
- );
- }
-
- $parent = $type->getParent() ? $this->getType($type->getParent()) : null;
-
- return new ResolvedFormType($type, $typeExtensions, $parent);
+ $this->resolvedTypeFactory = $resolvedTypeFactory;
}
/**
@@ -93,6 +80,7 @@ class FormRegistry implements FormRegistryInterface
}
if (!isset($this->types[$name])) {
+ /** @var FormTypeInterface $type */
$type = null;
foreach ($this->extensions as $extension) {
@@ -107,7 +95,22 @@ class FormRegistry implements FormRegistryInterface
throw new FormException(sprintf('Could not load type "%s"', $name));
}
- $this->addType($this->resolveType($type));
+ $parentType = $type->getParent();
+ $typeExtensions = array();
+
+ foreach ($this->extensions as $extension) {
+ /* @var FormExtensionInterface $extension */
+ $typeExtensions = array_merge(
+ $typeExtensions,
+ $extension->getTypeExtensions($name)
+ );
+ }
+
+ $this->addType($this->resolvedTypeFactory->createResolvedType(
+ $type,
+ $typeExtensions,
+ $parentType ? $this->getType($parentType) : null
+ ));
}
return $this->types[$name];
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistryInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistryInterface.php
index 55773d4..1dcf7dc 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistryInterface.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRegistryInterface.php
@@ -22,6 +22,10 @@ interface FormRegistryInterface
* Adds a form type.
*
* @param ResolvedFormTypeInterface $type The type
+ *
+ * @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
+ * form extensions or type registration in the Dependency
+ * Injection Container instead.
*/
public function addType(ResolvedFormTypeInterface $type);
@@ -48,18 +52,6 @@ interface FormRegistryInterface
*/
public function hasType($name);
- /**
- * Resolves a form type.
- *
- * @param FormTypeInterface $type
- *
- * @return ResolvedFormTypeInterface
- *
- * @throws Exception\UnexpectedTypeException if the types parent {@link FormTypeInterface::getParent()} is not a string
- * @throws Exception\FormException if the types parent can not be retrieved from any extension
- */
- public function resolveType(FormTypeInterface $type);
-
/**
* Returns the guesser responsible for guessing types.
*
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php
index 4d5538f..5c7c07e 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/FormRenderer.php
@@ -22,6 +22,8 @@ use Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface;
*/
class FormRenderer implements FormRendererInterface
{
+ const CACHE_KEY_VAR = 'unique_block_prefix';
+
/**
* @var FormRendererEngineInterface
*/
@@ -42,11 +44,6 @@ class FormRenderer implements FormRendererInterface
*/
private $hierarchyLevelMap = array();
- /**
- * @var array
- */
- private $variableMap = array();
-
/**
* @var array
*/
@@ -95,7 +92,8 @@ class FormRenderer implements FormRendererInterface
throw new FormException('This method should only be called while rendering a form element.');
}
- $scopeVariables = end($this->variableStack);
+ $viewCacheKey = $view->vars[self::CACHE_KEY_VAR];
+ $scopeVariables = end($this->variableStack[$viewCacheKey]);
$resource = $this->engine->getResourceForBlockName($view, $blockName);
@@ -117,13 +115,13 @@ class FormRenderer implements FormRendererInterface
// cannot be overwritten
$variables = array_replace($scopeVariables, $variables);
- $this->variableStack[] = $variables;
+ $this->variableStack[$viewCacheKey][] = $variables;
// Do the rendering
$html = $this->engine->renderBlock($view, $resource, $blockName, $variables);
// Clear the stack
- array_pop($this->variableStack);
+ array_pop($this->variableStack[$viewCacheKey]);
return $html;
}
@@ -133,14 +131,15 @@ class FormRenderer implements FormRendererInterface
*/
public function searchAndRenderBlock(FormView $view, $blockNameSuffix, array $variables = array())
{
- $renderOnlyOnce = in_array($blockNameSuffix, array('row', 'widget'));
+ $renderOnlyOnce = 'row' === $blockNameSuffix || 'widget' === $blockNameSuffix;
if ($renderOnlyOnce && $view->isRendered()) {
return '';
}
// The cache key for storing the variables and types
- $mapKey = $uniqueBlockName = $view->vars['full_block_name'] . '_' . $blockNameSuffix;
+ $viewCacheKey = $view->vars[self::CACHE_KEY_VAR];
+ $viewAndSuffixCacheKey = $viewCacheKey . $blockNameSuffix;
// In templates, we have to deal with two kinds of block hierarchies:
//
@@ -169,29 +168,40 @@ class FormRenderer implements FormRendererInterface
// widget() function again to render the block for the parent type.
//
// The second kind is implemented in the following blocks.
- if (!isset($this->blockNameHierarchyMap[$mapKey])) {
+ if (!isset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey])) {
// INITIAL CALL
// Calculate the hierarchy of template blocks and start on
// the bottom level of the hierarchy (= "__" block)
$blockNameHierarchy = array();
- foreach ($view->vars['types'] as $type) {
- $blockNameHierarchy[] = $type . '_' . $blockNameSuffix;
+ foreach ($view->vars['block_prefixes'] as $blockNamePrefix) {
+ $blockNameHierarchy[] = $blockNamePrefix . '_' . $blockNameSuffix;
}
- $blockNameHierarchy[] = $uniqueBlockName;
$hierarchyLevel = count($blockNameHierarchy) - 1;
- // The default variable scope contains all view variables, merged with
- // the variables passed explicitly to the helper
- $scopeVariables = $view->vars;
+ $hierarchyInit = true;
} else {
// RECURSIVE CALL
// If a block recursively calls renderSection() again, resume rendering
// using the parent type in the hierarchy.
- $blockNameHierarchy = $this->blockNameHierarchyMap[$mapKey];
- $hierarchyLevel = $this->hierarchyLevelMap[$mapKey] - 1;
+ $blockNameHierarchy = $this->blockNameHierarchyMap[$viewAndSuffixCacheKey];
+ $hierarchyLevel = $this->hierarchyLevelMap[$viewAndSuffixCacheKey] - 1;
+ $hierarchyInit = false;
+ }
+
+ // The variables are cached globally for a view (instead of for the
+ // current suffix)
+ if (!isset($this->variableStack[$viewCacheKey])) {
+ // The default variable scope contains all view variables, merged with
+ // the variables passed explicitly to the helper
+ $scopeVariables = $view->vars;
+
+ $varInit = true;
+ } else {
// Reuse the current scope and merge it with the explicitly passed variables
- $scopeVariables = $this->variableMap[$mapKey];
+ $scopeVariables = end($this->variableStack[$viewCacheKey]);
+
+ $varInit = false;
}
// Load the resource where this block can be found
@@ -235,28 +245,29 @@ class FormRenderer implements FormRendererInterface
// We need to store these values in maps (associative arrays) because within a
// call to widget() another call to widget() can be made, but for a different view
// object. These nested calls should not override each other.
- $this->blockNameHierarchyMap[$mapKey] = $blockNameHierarchy;
- $this->hierarchyLevelMap[$mapKey] = $hierarchyLevel;
- $this->variableMap[$mapKey] = $variables;
+ $this->blockNameHierarchyMap[$viewAndSuffixCacheKey] = $blockNameHierarchy;
+ $this->hierarchyLevelMap[$viewAndSuffixCacheKey] = $hierarchyLevel;
- // We also need to store the view and the variables so that we can render custom
- // blocks with renderBlock() using the same themes and variables as in the outer
- // block.
- //
- // A stack is sufficient for this purpose, because renderBlock() always accesses
- // the immediate next outer scope, which is always stored at the end of the stack.
- $this->variableStack[] = $variables;
+ // We also need to store the variables for the view so that we can render other
+ // blocks for the same view using the same variables as in the outer block.
+ $this->variableStack[$viewCacheKey][] = $variables;
// Do the rendering
$html = $this->engine->renderBlock($view, $resource, $blockName, $variables);
// Clear the stack
- array_pop($this->variableStack);
+ array_pop($this->variableStack[$viewCacheKey]);
- // Clear the maps
- unset($this->blockNameHierarchyMap[$mapKey]);
- unset($this->hierarchyLevelMap[$mapKey]);
- unset($this->variableMap[$mapKey]);
+ // Clear the caches if they were filled for the first time within
+ // this function call
+ if ($hierarchyInit) {
+ unset($this->blockNameHierarchyMap[$viewAndSuffixCacheKey]);
+ unset($this->hierarchyLevelMap[$viewAndSuffixCacheKey]);
+ }
+
+ if ($varInit) {
+ unset($this->variableStack[$viewCacheKey]);
+ }
if ($renderOnlyOnce) {
$view->setRendered();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/ImmutableFormConfig.php b/vendor/symfony/symfony/src/Symfony/Component/Form/ImmutableFormConfig.php
deleted file mode 100644
index 36bd867..0000000
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/ImmutableFormConfig.php
+++ /dev/null
@@ -1,365 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\Form;
-
-use Symfony\Component\Form\Util\PropertyPath;
-use Symfony\Component\EventDispatcher\ImmutableEventDispatcher;
-
-/**
- * A read-only form configuration.
- *
- * @author Bernhard Schussek
- */
-class ImmutableFormConfig implements FormConfigInterface
-{
- /**
- * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
- */
- private $dispatcher;
-
- /**
- * @var string
- */
- private $name;
-
- /**
- * @var PropertyPath
- */
- private $propertyPath;
-
- /**
- * @var Boolean
- */
- private $mapped;
-
- /**
- * @var Boolean
- */
- private $byReference;
-
- /**
- * @var Boolean
- */
- private $virtual;
-
- /**
- * @var Boolean
- */
- private $compound;
-
- /**
- * @var ResolvedFormTypeInterface
- */
- private $type;
-
- /**
- * @var array
- */
- private $viewTransformers;
-
- /**
- * @var array
- */
- private $modelTransformers;
-
- /**
- * @var DataMapperInterface
- */
- private $dataMapper;
-
- /**
- * @var FormValidatorInterface
- */
- private $validators;
-
- /**
- * @var Boolean
- */
- private $required;
-
- /**
- * @var Boolean
- */
- private $disabled;
-
- /**
- * @var Boolean
- */
- private $errorBubbling;
-
- /**
- * @var mixed
- */
- private $emptyData;
-
- /**
- * @var array
- */
- private $attributes;
-
- /**
- * @var mixed
- */
- private $data;
-
- /**
- * @var string
- */
- private $dataClass;
-
- /**
- * @var Boolean
- */
- private $dataLocked;
-
- /**
- * @var array
- */
- private $options;
-
- /**
- * Creates an unmodifiable copy of a given configuration.
- *
- * @param FormConfigInterface $config The configuration to copy.
- */
- public function __construct(FormConfigInterface $config)
- {
- $dispatcher = $config->getEventDispatcher();
- if (!$dispatcher instanceof ImmutableEventDispatcher) {
- $dispatcher = new ImmutableEventDispatcher($dispatcher);
- }
-
- $this->dispatcher = $dispatcher;
- $this->name = $config->getName();
- $this->propertyPath = $config->getPropertyPath();
- $this->mapped = $config->getMapped();
- $this->byReference = $config->getByReference();
- $this->virtual = $config->getVirtual();
- $this->compound = $config->getCompound();
- $this->type = $config->getType();
- $this->viewTransformers = $config->getViewTransformers();
- $this->modelTransformers = $config->getModelTransformers();
- $this->dataMapper = $config->getDataMapper();
- $this->validators = $config->getValidators();
- $this->required = $config->getRequired();
- $this->disabled = $config->getDisabled();
- $this->errorBubbling = $config->getErrorBubbling();
- $this->emptyData = $config->getEmptyData();
- $this->attributes = $config->getAttributes();
- $this->data = $config->getData();
- $this->dataClass = $config->getDataClass();
- $this->dataLocked = $config->getDataLocked();
- $this->options = $config->getOptions();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getEventDispatcher()
- {
- return $this->dispatcher;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getPropertyPath()
- {
- return $this->propertyPath;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getMapped()
- {
- return $this->mapped;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getByReference()
- {
- return $this->byReference;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVirtual()
- {
- return $this->virtual;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getCompound()
- {
- return $this->compound;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getViewTransformers()
- {
- return $this->viewTransformers;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getModelTransformers()
- {
- return $this->modelTransformers;
- }
-
- /**
- * Returns the data mapper of the form.
- *
- * @return DataMapperInterface The data mapper.
- */
- public function getDataMapper()
- {
- return $this->dataMapper;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getValidators()
- {
- return $this->validators;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getRequired()
- {
- return $this->required;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDisabled()
- {
- return $this->disabled;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getErrorBubbling()
- {
- return $this->errorBubbling;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getEmptyData()
- {
- return $this->emptyData;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAttributes()
- {
- return $this->attributes;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasAttribute($name)
- {
- return isset($this->attributes[$name]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getAttribute($name, $default = null)
- {
- return isset($this->attributes[$name]) ? $this->attributes[$name] : $default;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getData()
- {
- return $this->data;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDataClass()
- {
- return $this->dataClass;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getDataLocked()
- {
- return $this->dataLocked;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getOptions()
- {
- return $this->options;
- }
-
- /**
- * {@inheritdoc}
- */
- public function hasOption($name)
- {
- return isset($this->options[$name]);
- }
-
- /**
- * {@inheritdoc}
- */
- public function getOption($name, $default = null)
- {
- return isset($this->options[$name]) ? $this->options[$name] : $default;
- }
-}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php
index 8bbd7ae..64427a8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormType.php
@@ -35,7 +35,7 @@ class ResolvedFormType implements ResolvedFormTypeInterface
private $typeExtensions;
/**
- * @var ResolvedFormType
+ * @var ResolvedFormTypeInterface
*/
private $parent;
@@ -44,7 +44,7 @@ class ResolvedFormType implements ResolvedFormTypeInterface
*/
private $optionsResolver;
- public function __construct(FormTypeInterface $innerType, array $typeExtensions = array(), ResolvedFormType $parent = null)
+ public function __construct(FormTypeInterface $innerType, array $typeExtensions = array(), ResolvedFormTypeInterface $parent = null)
{
if (!preg_match('/^[a-z0-9_]*$/i', $innerType->getName())) {
throw new FormException(sprintf(
@@ -148,7 +148,16 @@ class ResolvedFormType implements ResolvedFormTypeInterface
return $view;
}
- private function buildForm(FormBuilderInterface $builder, array $options)
+ /**
+ * Configures a form builder for the type hierarchy.
+ *
+ * This method is protected in order to allow implementing classes
+ * to change or call it in re-implementations of {@link createBuilder()}.
+ *
+ * @param FormBuilderInterface $builder The builder to configure.
+ * @param array $options The options used for the configuration.
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options)
{
if (null !== $this->parent) {
$this->parent->buildForm($builder, $options);
@@ -162,7 +171,19 @@ class ResolvedFormType implements ResolvedFormTypeInterface
}
}
- private function buildView(FormView $view, FormInterface $form, array $options)
+ /**
+ * Configures a form view for the type hierarchy.
+ *
+ * This method is protected in order to allow implementing classes
+ * to change or call it in re-implementations of {@link createView()}.
+ *
+ * It is called before the children of the view are built.
+ *
+ * @param FormView $view The form view to configure.
+ * @param FormInterface $form The form corresponding to the view.
+ * @param array $options The options used for the configuration.
+ */
+ public function buildView(FormView $view, FormInterface $form, array $options)
{
if (null !== $this->parent) {
$this->parent->buildView($view, $form, $options);
@@ -176,7 +197,19 @@ class ResolvedFormType implements ResolvedFormTypeInterface
}
}
- private function finishView(FormView $view, FormInterface $form, array $options)
+ /**
+ * Finishes a form view for the type hierarchy.
+ *
+ * This method is protected in order to allow implementing classes
+ * to change or call it in re-implementations of {@link createView()}.
+ *
+ * It is called after the children of the view have been built.
+ *
+ * @param FormView $view The form view to configure.
+ * @param FormInterface $form The form corresponding to the view.
+ * @param array $options The options used for the configuration.
+ */
+ public function finishView(FormView $view, FormInterface $form, array $options)
{
if (null !== $this->parent) {
$this->parent->finishView($view, $form, $options);
@@ -190,7 +223,15 @@ class ResolvedFormType implements ResolvedFormTypeInterface
}
}
- private function getOptionsResolver()
+ /**
+ * Returns the configured options resolver used for this type.
+ *
+ * This method is protected in order to allow implementing classes
+ * to change or call it in re-implementations of {@link createBuilder()}.
+ *
+ * @return \Symfony\Component\OptionsResolver\OptionsResolverInterface The options resolver.
+ */
+ public function getOptionsResolver()
{
if (null === $this->optionsResolver) {
if (null !== $this->parent) {
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactory.php b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactory.php
new file mode 100644
index 0000000..d93d1c0
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactory.php
@@ -0,0 +1,26 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Form;
+
+/**
+ * @author Bernhard Schussek
+ */
+class ResolvedFormTypeFactory implements ResolvedFormTypeFactoryInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function createResolvedType(FormTypeInterface $type, array $typeExtensions, ResolvedFormTypeInterface $parent = null)
+ {
+ return new ResolvedFormType($type, $typeExtensions, $parent);
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php
new file mode 100644
index 0000000..fb2aa4a
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeFactoryInterface.php
@@ -0,0 +1,38 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Form;
+
+/**
+ * Creates ResolvedFormTypeInterface instances.
+ *
+ * This interface allows you to use your custom ResolvedFormTypeInterface
+ * implementation, within which you can customize the concrete FormBuilderInterface
+ * implementations or FormView subclasses that are used by the framework.
+ *
+ * @author Bernhard Schussek
+ */
+interface ResolvedFormTypeFactoryInterface
+{
+ /**
+ * Resolves a form type.
+ *
+ * @param FormTypeInterface $type
+ * @param array $typeExtensions
+ * @param ResolvedFormTypeInterface $parent
+ *
+ * @return ResolvedFormTypeInterface
+ *
+ * @throws Exception\UnexpectedTypeException if the types parent {@link FormTypeInterface::getParent()} is not a string
+ * @throws Exception\FormException if the types parent can not be retrieved from any extension
+ */
+ public function createResolvedType(FormTypeInterface $type, array $typeExtensions, ResolvedFormTypeInterface $parent = null);
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeInterface.php b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
index cb9787c..c6333d5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/ResolvedFormTypeInterface.php
@@ -67,4 +67,41 @@ interface ResolvedFormTypeInterface
* @return FormView The created form view.
*/
public function createView(FormInterface $form, FormView $parent = null);
+
+ /**
+ * Configures a form builder for the type hierarchy.
+ *
+ * @param FormBuilderInterface $builder The builder to configure.
+ * @param array $options The options used for the configuration.
+ */
+ public function buildForm(FormBuilderInterface $builder, array $options);
+
+ /**
+ * Configures a form view for the type hierarchy.
+ *
+ * It is called before the children of the view are built.
+ *
+ * @param FormView $view The form view to configure.
+ * @param FormInterface $form The form corresponding to the view.
+ * @param array $options The options used for the configuration.
+ */
+ public function buildView(FormView $view, FormInterface $form, array $options);
+
+ /**
+ * Finishes a form view for the type hierarchy.
+ *
+ * It is called after the children of the view have been built.
+ *
+ * @param FormView $view The form view to configure.
+ * @param FormInterface $form The form corresponding to the view.
+ * @param array $options The options used for the configuration.
+ */
+ public function finishView(FormView $view, FormInterface $form, array $options);
+
+ /**
+ * Returns the configured options resolver used for this type.
+ *
+ * @return \Symfony\Component\OptionsResolver\OptionsResolverInterface The options resolver.
+ */
+ public function getOptionsResolver();
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php
index bb97cd6..576d789 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Tests;
use Symfony\Component\Form\FormError;
+use Symfony\Component\Form\Tests\Fixtures\AlternatingRowType;
abstract class AbstractDivLayoutTest extends AbstractLayoutTest
{
@@ -38,13 +39,17 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
public function testRowOverrideVariables()
{
$view = $this->factory->createNamed('name', 'text')->createView();
- $html = $this->renderRow($view, array('label' => 'foo&bar'));
+ $html = $this->renderRow($view, array(
+ 'attr' => array('class' => 'my&class'),
+ 'label' => 'foo&bar',
+ 'label_attr' => array('class' => 'my&label&class'),
+ ));
$this->assertMatchesXpath($html,
'/div
[
- ./label[@for="name"][.="[trans]foo&bar[/trans]"]
- /following-sibling::input[@id="name"]
+ ./label[@for="name"][@class="my&label&class required"][.="[trans]foo&bar[/trans]"]
+ /following-sibling::input[@id="name"][@class="my&class"]
]
'
);
@@ -279,6 +284,29 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
);
}
+ // https://github.com/symfony/symfony/issues/5038
+ public function testCollectionWithAlternatingRowTypes()
+ {
+ $data = array(
+ array('title' => 'a'),
+ array('title' => 'b'),
+ );
+ $form = $this->factory->createNamed('name', 'collection', $data, array(
+ 'type' => new AlternatingRowType(),
+ ));
+
+ $this->assertWidgetMatchesXpath($form->createView(), array(),
+'/div
+ [
+ ./div[./div/div/input[@type="text"][@value="a"]]
+ /following-sibling::div[./div/div/textarea[.="b"]]
+ ]
+ [count(./div[./div/div/input])=1]
+ [count(./div[./div/div/textarea])=1]
+'
+ );
+ }
+
public function testEmptyCollection()
{
$form = $this->factory->createNamed('name', 'collection', array(), array(
@@ -437,7 +465,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest
public function testRepeatedWithCustomOptions()
{
$form = $this->factory->createNamed('name', 'repeated', null, array(
- // the global required value cannot be overriden
+ // the global required value cannot be overridden
'first_options' => array('label' => 'Test', 'required' => false),
'second_options' => array('label' => 'Test2')
));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
index 40195c2..e938a5f 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
@@ -66,7 +66,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
// the top level
$dom->loadXml(''.$html.'');
} catch (\Exception $e) {
- return $this->fail(sprintf(
+ $this->fail(sprintf(
"Failed loading HTML:\n\n%s\n\nError: %s",
$html,
$e->getMessage()
@@ -225,7 +225,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
);
}
- public function testLabelWithCustomOptionsPassedDirectly()
+ public function testLabelWithCustomAttributesPassedDirectly()
{
$form = $this->factory->createNamed('name', 'text');
$html = $this->renderLabel($form->createView(), null, array(
@@ -242,7 +242,7 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
);
}
- public function testLabelWithCustomTextAndCustomOptionsPassedDirectly()
+ public function testLabelWithCustomTextAndCustomAttributesPassedDirectly()
{
$form = $this->factory->createNamed('name', 'text');
$html = $this->renderLabel($form->createView(), 'Custom label', array(
@@ -260,6 +260,27 @@ abstract class AbstractLayoutTest extends FormIntegrationTestCase
);
}
+ // https://github.com/symfony/symfony/issues/5029
+ public function testLabelWithCustomTextAsOptionAndCustomAttributesPassedDirectly()
+ {
+ $form = $this->factory->createNamed('name', 'text', null, array(
+ 'label' => 'Custom label',
+ ));
+ $html = $this->renderLabel($form->createView(), null, array(
+ 'label_attr' => array(
+ 'class' => 'my&class'
+ ),
+ ));
+
+ $this->assertMatchesXpath($html,
+ '/label
+ [@for="name"]
+ [@class="my&class required"]
+ [.="[trans]Custom label[/trans]"]
+'
+ );
+ }
+
public function testErrors()
{
$form = $this->factory->createNamed('name', 'text');
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php
index 1436d83..c21c712 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php
@@ -116,7 +116,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest
->getForm()
->createView();
- // Render field2 row -> does not implicitely call renderWidget because
+ // Render field2 row -> does not implicitly call renderWidget because
// it is a repeated field!
$this->renderRow($view['field2']);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormTest.php
index 4e59185..122a44a 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/CompoundFormTest.php
@@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Tests;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormError;
-use Symfony\Component\Form\Extension\Core\EventListener\BindRequestListener;
+use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\EventDispatcher\EventDispatcher;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php
index 8dc3828..86533e8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php
@@ -69,8 +69,40 @@ class ChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3'), $this->list->getValues());
- $this->assertEquals(array(1 => new ChoiceView('1', 'B')), $this->list->getPreferredViews());
- $this->assertEquals(array(0 => new ChoiceView('0', 'A'), 2 => new ChoiceView('2', 'C'), 3 => new ChoiceView('3', 'D')), $this->list->getRemainingViews());
+ $this->assertEquals(array(1 => new ChoiceView($this->obj2, '1', 'B')), $this->list->getPreferredViews());
+ $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews());
+ }
+
+ /**
+ * Necessary for interoperability with MongoDB cursors or ORM relations as
+ * choices parameter. A choice itself that is an object implementing \Traversable
+ * is not treated as hierarchical structure, but as-is.
+ */
+ public function testInitNestedTraversable()
+ {
+ $traversableChoice = new \ArrayIterator(array($this->obj3, $this->obj4));
+
+ $this->list = new ChoiceList(
+ new \ArrayIterator(array(
+ 'Group' => array($this->obj1, $this->obj2),
+ 'Not a Group' => $traversableChoice
+ )),
+ array(
+ 'Group' => array('A', 'B'),
+ 'Not a Group' => 'C',
+ ),
+ array($this->obj2)
+ );
+
+ $this->assertSame(array($this->obj1, $this->obj2, $traversableChoice), $this->list->getChoices());
+ $this->assertSame(array('0', '1', '2'), $this->list->getValues());
+ $this->assertEquals(array(
+ 'Group' => array(1 => new ChoiceView($this->obj2, '1', 'B'))
+ ), $this->list->getPreferredViews());
+ $this->assertEquals(array(
+ 'Group' => array(0 => new ChoiceView($this->obj1, '0', 'A')),
+ 2 => new ChoiceView($traversableChoice, '2', 'C')
+ ), $this->list->getRemainingViews());
}
public function testInitNestedArray()
@@ -78,12 +110,12 @@ class ChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3'), $this->list->getValues());
$this->assertEquals(array(
- 'Group 1' => array(1 => new ChoiceView('1', 'B')),
- 'Group 2' => array(2 => new ChoiceView('2', 'C'))
+ 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')),
+ 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C'))
), $this->list->getPreferredViews());
$this->assertEquals(array(
- 'Group 1' => array(0 => new ChoiceView('0', 'A')),
- 'Group 2' => array(3 => new ChoiceView('3', 'D'))
+ 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')),
+ 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D'))
), $this->list->getRemainingViews());
}
@@ -141,4 +173,15 @@ class ChoiceListTest extends \PHPUnit_Framework_TestCase
$choices = array($this->obj2, $this->obj3, 'foobar');
$this->assertSame(array('1', '2'), $this->list->getValuesForChoices($choices));
}
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testNonMatchingLabels()
+ {
+ $this->list = new ChoiceList(
+ array($this->obj1, $this->obj2),
+ array('A')
+ );
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php
index 752be7d..628ac60 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/LazyChoiceListTest.php
@@ -49,12 +49,12 @@ class LazyChoiceListTest extends \PHPUnit_Framework_TestCase
public function testGetPreferredViews()
{
- $this->assertEquals(array(1 => new ChoiceView('b', 'B')), $this->list->getPreferredViews());
+ $this->assertEquals(array(1 => new ChoiceView('b', 'b', 'B')), $this->list->getPreferredViews());
}
public function testGetRemainingViews()
{
- $this->assertEquals(array(0 => new ChoiceView('a', 'A'), 2 => new ChoiceView('c', 'C')), $this->list->getRemainingViews());
+ $this->assertEquals(array(0 => new ChoiceView('a', 'a', 'A'), 2 => new ChoiceView('c', 'c', 'C')), $this->list->getRemainingViews());
}
public function testGetIndicesForChoices()
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php
index 44c1c8f..12f22d2 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php
@@ -81,8 +81,8 @@ class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3'), $this->list->getValues());
- $this->assertEquals(array(1 => new ChoiceView('1', 'B')), $this->list->getPreferredViews());
- $this->assertEquals(array(0 => new ChoiceView('0', 'A'), 2 => new ChoiceView('2', 'C'), 3 => new ChoiceView('3', 'D')), $this->list->getRemainingViews());
+ $this->assertEquals(array(1 => new ChoiceView($this->obj2, '1', 'B')), $this->list->getPreferredViews());
+ $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews());
}
public function testInitNestedArray()
@@ -90,12 +90,12 @@ class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3'), $this->list->getValues());
$this->assertEquals(array(
- 'Group 1' => array(1 => new ChoiceView('1', 'B')),
- 'Group 2' => array(2 => new ChoiceView('2', 'C'))
+ 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')),
+ 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C'))
), $this->list->getPreferredViews());
$this->assertEquals(array(
- 'Group 1' => array(0 => new ChoiceView('0', 'A')),
- 'Group 2' => array(3 => new ChoiceView('3', 'D'))
+ 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')),
+ 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D'))
), $this->list->getRemainingViews());
}
@@ -123,14 +123,14 @@ class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4, $obj5, $obj6), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3', '4', '5'), $this->list->getValues());
$this->assertEquals(array(
- 'Group 1' => array(1 => new ChoiceView('1', 'B')),
- 'Group 2' => array(2 => new ChoiceView('2', 'C'))
+ 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')),
+ 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C'))
), $this->list->getPreferredViews());
$this->assertEquals(array(
- 'Group 1' => array(0 => new ChoiceView('0', 'A')),
- 'Group 2' => array(3 => new ChoiceView('3', 'D')),
- 4 => new ChoiceView('4', 'E'),
- 5 => new ChoiceView('5', 'F'),
+ 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')),
+ 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')),
+ 4 => new ChoiceView($obj5, '4', 'E'),
+ 5 => new ChoiceView($obj6, '5', 'F'),
), $this->list->getRemainingViews());
}
@@ -172,8 +172,8 @@ class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('10', '20', '30', '40'), $this->list->getValues());
- $this->assertEquals(array(1 => new ChoiceView('20', 'B'), 2 => new ChoiceView('30', 'C')), $this->list->getPreferredViews());
- $this->assertEquals(array(0 => new ChoiceView('10', 'A'), 3 => new ChoiceView('40', 'D')), $this->list->getRemainingViews());
+ $this->assertEquals(array(1 => new ChoiceView($this->obj2, '20', 'B'), 2 => new ChoiceView($this->obj3, '30', 'C')), $this->list->getPreferredViews());
+ $this->assertEquals(array(0 => new ChoiceView($this->obj1, '10', 'A'), 3 => new ChoiceView($this->obj4, '40', 'D')), $this->list->getRemainingViews());
}
public function testInitArrayUsesToString()
@@ -189,7 +189,7 @@ class ObjectChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array($this->obj1, $this->obj2, $this->obj3, $this->obj4), $this->list->getChoices());
$this->assertSame(array('0', '1', '2', '3'), $this->list->getValues());
- $this->assertEquals(array(0 => new ChoiceView('0', 'A'), 1 => new ChoiceView('1', 'B'), 2 => new ChoiceView('2', 'C'), 3 => new ChoiceView('3', 'D')), $this->list->getRemainingViews());
+ $this->assertEquals(array(0 => new ChoiceView($this->obj1, '0', 'A'), 1 => new ChoiceView($this->obj2, '1', 'B'), 2 => new ChoiceView($this->obj3, '2', 'C'), 3 => new ChoiceView($this->obj4, '3', 'D')), $this->list->getRemainingViews());
}
/**
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php
index 485923c..69d27a1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php
@@ -55,8 +55,8 @@ class SimpleChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getChoices());
$this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c'), $this->list->getValues());
- $this->assertEquals(array(1 => new ChoiceView('b', 'B')), $this->list->getPreferredViews());
- $this->assertEquals(array(0 => new ChoiceView('a', 'A'), 2 => new ChoiceView('c', 'C')), $this->list->getRemainingViews());
+ $this->assertEquals(array(1 => new ChoiceView('b', 'b', 'B')), $this->list->getPreferredViews());
+ $this->assertEquals(array(0 => new ChoiceView('a', 'a', 'A'), 2 => new ChoiceView('c', 'c', 'C')), $this->list->getRemainingViews());
}
public function testInitNestedArray()
@@ -64,12 +64,12 @@ class SimpleChoiceListTest extends \PHPUnit_Framework_TestCase
$this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $this->list->getChoices());
$this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $this->list->getValues());
$this->assertEquals(array(
- 'Group 1' => array(1 => new ChoiceView('b', 'B')),
- 'Group 2' => array(2 => new ChoiceView('c', 'C'))
+ 'Group 1' => array(1 => new ChoiceView('b', 'b', 'B')),
+ 'Group 2' => array(2 => new ChoiceView('c', 'c', 'C'))
), $this->list->getPreferredViews());
$this->assertEquals(array(
- 'Group 1' => array(0 => new ChoiceView('a', 'A')),
- 'Group 2' => array(3 => new ChoiceView('d', 'D'))
+ 'Group 1' => array(0 => new ChoiceView('a', 'a', 'A')),
+ 'Group 2' => array(3 => new ChoiceView('d', 'd', 'D'))
), $this->list->getRemainingViews());
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php
index 0a4c8b8..05d2fe1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/DataMapper/PropertyPathMapperTest.php
@@ -12,7 +12,7 @@
namespace Symfony\Component\Form\Tests\Extension\Core\DataMapper;
use Symfony\Component\Form\Form;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormConfigInterface;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Form\Extension\Core\DataMapper\PropertyPathMapper;
@@ -89,7 +89,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->with($car)
->will($this->returnValue($engine));
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$form = $this->getForm($config);
@@ -112,7 +112,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->with($car)
->will($this->returnValue($engine));
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(false);
$config->setPropertyPath($propertyPath);
$form = $this->getForm($config);
@@ -127,7 +127,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
{
$car = new \stdClass();
- $config = new FormConfig(null, '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder(null, '\stdClass', $this->dispatcher);
$config->setByReference(true);
$form = $this->getForm($config);
@@ -146,7 +146,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('getValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setMapped(false);
$config->setPropertyPath($propertyPath);
@@ -164,7 +164,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('getValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$form = $this->getForm($config);
@@ -185,14 +185,14 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->with($car)
->will($this->returnValue($engine));
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setVirtual(true);
$config->setCompound(true);
$config->setDataMapper($this->getDataMapper());
$form = $this->getForm($config);
- $config = new FormConfig('engine', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('engine', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$child = $this->getForm($config);
@@ -215,7 +215,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->method('setValue')
->with($car, $engine);
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(false);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -234,7 +234,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->method('setValue')
->with($car, $engine);
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -258,7 +258,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('setValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -276,7 +276,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('setValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -294,7 +294,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('setValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData(null);
@@ -312,7 +312,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('setValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -330,7 +330,7 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
$propertyPath->expects($this->never())
->method('setValue');
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($propertyPath);
$config->setData($engine);
@@ -356,14 +356,14 @@ class PropertyPathMapperTest extends \PHPUnit_Framework_TestCase
->method('setValue')
->with($car, $engine);
- $config = new FormConfig('name', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', '\stdClass', $this->dispatcher);
$config->setPropertyPath($parentPath);
$config->setVirtual(true);
$config->setCompound(true);
$config->setDataMapper($this->getDataMapper());
$form = $this->getForm($config);
- $config = new FormConfig('engine', '\stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('engine', '\stdClass', $this->dispatcher);
$config->setByReference(true);
$config->setPropertyPath($childPath);
$config->setData($engine);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php
index 7b3490c..5971777 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php
@@ -654,10 +654,10 @@ class ChoiceTypeTest extends TypeTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('a', 'A'),
- new ChoiceView('b', 'B'),
- new ChoiceView('c', 'C'),
- new ChoiceView('d', 'D'),
+ new ChoiceView('a', 'a', 'A'),
+ new ChoiceView('b', 'b', 'B'),
+ new ChoiceView('c', 'c', 'C'),
+ new ChoiceView('d', 'd', 'D'),
), $view->vars['choices']);
}
@@ -671,12 +671,12 @@ class ChoiceTypeTest extends TypeTestCase
$view = $form->createView();
$this->assertEquals(array(
- 0 => new ChoiceView('a', 'A'),
- 2 => new ChoiceView('c', 'C'),
+ 0 => new ChoiceView('a', 'a', 'A'),
+ 2 => new ChoiceView('c', 'c', 'C'),
), $view->vars['choices']);
$this->assertEquals(array(
- 1 => new ChoiceView('b', 'B'),
- 3 => new ChoiceView('d', 'D'),
+ 1 => new ChoiceView('b', 'b', 'B'),
+ 3 => new ChoiceView('d', 'd', 'D'),
), $view->vars['preferred_choices']);
}
@@ -690,23 +690,42 @@ class ChoiceTypeTest extends TypeTestCase
$this->assertEquals(array(
'Symfony' => array(
- 0 => new ChoiceView('a', 'Bernhard'),
- 2 => new ChoiceView('c', 'Kris'),
+ 0 => new ChoiceView('a', 'a', 'Bernhard'),
+ 2 => new ChoiceView('c', 'c', 'Kris'),
),
'Doctrine' => array(
- 4 => new ChoiceView('e', 'Roman'),
+ 4 => new ChoiceView('e', 'e', 'Roman'),
),
), $view->vars['choices']);
$this->assertEquals(array(
'Symfony' => array(
- 1 => new ChoiceView('b', 'Fabien'),
+ 1 => new ChoiceView('b', 'b', 'Fabien'),
),
'Doctrine' => array(
- 3 => new ChoiceView('d', 'Jon'),
+ 3 => new ChoiceView('d', 'd', 'Jon'),
),
), $view->vars['preferred_choices']);
}
+ public function testPassChoiceDataToView()
+ {
+ $obj1 = (object) array('value' => 'a', 'label' => 'A');
+ $obj2 = (object) array('value' => 'b', 'label' => 'B');
+ $obj3 = (object) array('value' => 'c', 'label' => 'C');
+ $obj4 = (object) array('value' => 'd', 'label' => 'D');
+ $form = $this->factory->create('choice', null, array(
+ 'choice_list' => new ObjectChoiceList(array($obj1, $obj2, $obj3, $obj4), 'label', array(), null, 'value'),
+ ));
+ $view = $form->createView();
+
+ $this->assertEquals(array(
+ new ChoiceView($obj1, 'a', 'A'),
+ new ChoiceView($obj2, 'b', 'B'),
+ new ChoiceView($obj3, 'c', 'C'),
+ new ChoiceView($obj4, 'd', 'D'),
+ ), $view->vars['choices']);
+ }
+
public function testAdjustFullNameForMultipleNonExpanded()
{
$form = $this->factory->createNamed('name', 'choice', null, array(
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php
index b607c3f..e5c24a3 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php
@@ -24,11 +24,11 @@ class CountryTypeTest extends LocalizedTestCase
$choices = $view->vars['choices'];
// Don't check objects for identity
- $this->assertContains(new ChoiceView('DE', 'Deutschland'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('GB', 'Vereinigtes Königreich'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('US', 'Vereinigte Staaten'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('FR', 'Frankreich'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('MY', 'Malaysia'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('DE', 'DE', 'Deutschland'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('GB', 'GB', 'Vereinigtes Königreich'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('US', 'US', 'Vereinigte Staaten'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('FR', 'FR', 'Frankreich'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('MY', 'MY', 'Malaysia'), $choices, '', false, false);
}
public function testUnknownCountryIsNotIncluded()
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
index 158d416..13b9d06 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php
@@ -355,8 +355,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('2010', '2010'),
- new ChoiceView('2011', '2011'),
+ new ChoiceView('2010', '2010', '2010'),
+ new ChoiceView('2011', '2011', '2011'),
), $view['year']->vars['choices']);
}
@@ -369,8 +369,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('6', '06'),
- new ChoiceView('7', '07'),
+ new ChoiceView('6', '6', '06'),
+ new ChoiceView('7', '7', '07'),
), $view['month']->vars['choices']);
}
@@ -384,8 +384,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('1', 'Jän'),
- new ChoiceView('4', 'Apr')
+ new ChoiceView('1', '1', 'Jän'),
+ new ChoiceView('4', '4', 'Apr')
), $view['month']->vars['choices']);
}
@@ -399,8 +399,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('1', 'Jänner'),
- new ChoiceView('4', 'April'),
+ new ChoiceView('1', '1', 'Jänner'),
+ new ChoiceView('4', '4', 'April'),
), $view['month']->vars['choices']);
}
@@ -414,8 +414,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('1', 'Jänner'),
- new ChoiceView('4', 'April'),
+ new ChoiceView('1', '1', 'Jänner'),
+ new ChoiceView('4', '4', 'April'),
), $view['month']->vars['choices']);
}
@@ -428,8 +428,8 @@ class DateTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('6', '06'),
- new ChoiceView('7', '07'),
+ new ChoiceView('6', '6', '06'),
+ new ChoiceView('7', '7', '07'),
), $view['day']->vars['choices']);
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php
index 8fe84a6..6fbddeb 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php
@@ -206,7 +206,7 @@ class FormTypeTest extends TypeTestCase
$this->assertEquals('test', $view['child']->vars['translation_domain']);
}
- public function testNonTranlsationDomainFormWithNonTranslationDomainParentBeingTranslationDomainDefault()
+ public function testNonTranslationDomainFormWithNonTranslationDomainParentBeingTranslationDomainDefault()
{
$parent = $this->factory->createNamed('parent', 'form');
$child = $this->factory->createNamed('child', 'form');
@@ -645,4 +645,18 @@ class FormTypeTest extends TypeTestCase
$this->assertSame('default', $form->getData());
}
+
+ public function testNormDataIsPassedToView()
+ {
+ $view = $this->factory->createBuilder('form')
+ ->addViewTransformer(new FixedDataTransformer(array(
+ 'foo' => 'bar',
+ )))
+ ->setData('foo')
+ ->getForm()
+ ->createView();
+
+ $this->assertSame('foo', $view->vars['data']);
+ $this->assertSame('bar', $view->vars['value']);
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php
index 399ae6e..62ddae7 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LanguageTypeTest.php
@@ -23,11 +23,11 @@ class LanguageTypeTest extends LocalizedTestCase
$view = $form->createView();
$choices = $view->vars['choices'];
- $this->assertContains(new ChoiceView('en', 'Englisch'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('en_GB', 'Britisches Englisch'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('en_US', 'Amerikanisches Englisch'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('fr', 'Französisch'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('my', 'Birmanisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('en', 'en', 'Englisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('en_GB', 'en_GB', 'Britisches Englisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('en_US', 'en_US', 'Amerikanisches Englisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('fr', 'fr', 'Französisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('my', 'my', 'Birmanisch'), $choices, '', false, false);
}
public function testMultipleLanguagesIsNotIncluded()
@@ -36,6 +36,6 @@ class LanguageTypeTest extends LocalizedTestCase
$view = $form->createView();
$choices = $view->vars['choices'];
- $this->assertNotContains(new ChoiceView('mul', 'Mehrsprachig'), $choices, '', false, false);
+ $this->assertNotContains(new ChoiceView('mul', 'mul', 'Mehrsprachig'), $choices, '', false, false);
}
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php
index 4c2e195..d02d2ba 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/LocaleTypeTest.php
@@ -23,8 +23,8 @@ class LocaleTypeTest extends LocalizedTestCase
$view = $form->createView();
$choices = $view->vars['choices'];
- $this->assertContains(new ChoiceView('en', 'Englisch'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('en_GB', 'Englisch (Vereinigtes Königreich)'), $choices, '', false, false);
- $this->assertContains(new ChoiceView('zh_Hant_MO', 'Chinesisch (traditionell, Sonderverwaltungszone Macao)'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('en', 'en', 'Englisch'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('en_GB', 'en_GB', 'Englisch (Vereinigtes Königreich)'), $choices, '', false, false);
+ $this->assertContains(new ChoiceView('zh_Hant_MO', 'zh_Hant_MO', 'Chinesisch (traditionell, Sonderverwaltungszone Macao)'), $choices, '', false, false);
}
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php
index 1c0cf3c..fa644e5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php
@@ -49,7 +49,7 @@ class RepeatedTypeTest extends TypeTestCase
public function testSetOptionsPerChild()
{
$form = $this->factory->create('repeated', null, array(
- // the global required value cannot be overriden
+ // the global required value cannot be overridden
'type' => 'text',
'first_options' => array('label' => 'Test', 'required' => false),
'second_options' => array('label' => 'Test2')
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
index 24873d2..5c0d960 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php
@@ -244,8 +244,8 @@ class TimeTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('6', '06'),
- new ChoiceView('7', '07'),
+ new ChoiceView('6', '6', '06'),
+ new ChoiceView('7', '7', '07'),
), $view['hour']->vars['choices']);
}
@@ -258,8 +258,8 @@ class TimeTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('6', '06'),
- new ChoiceView('7', '07'),
+ new ChoiceView('6', '6', '06'),
+ new ChoiceView('7', '7', '07'),
), $view['minute']->vars['choices']);
}
@@ -273,8 +273,8 @@ class TimeTypeTest extends LocalizedTestCase
$view = $form->createView();
$this->assertEquals(array(
- new ChoiceView('6', '06'),
- new ChoiceView('7', '07'),
+ new ChoiceView('6', '6', '06'),
+ new ChoiceView('7', '7', '07'),
), $view['second']->vars['choices']);
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php
index 113b8d7..fcb8c7e 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php
@@ -22,9 +22,9 @@ class TimezoneTypeTest extends TypeTestCase
$choices = $view->vars['choices'];
$this->assertArrayHasKey('Africa', $choices);
- $this->assertContains(new ChoiceView('Africa/Kinshasa', 'Kinshasa'), $choices['Africa'], '', false, false);
+ $this->assertContains(new ChoiceView('Africa/Kinshasa', 'Africa/Kinshasa', 'Kinshasa'), $choices['Africa'], '', false, false);
$this->assertArrayHasKey('America', $choices);
- $this->assertContains(new ChoiceView('America/New_York', 'New York'), $choices['America'], '', false, false);
+ $this->assertContains(new ChoiceView('America/New_York', 'America/New_York', 'New York'), $choices['America'], '', false, false);
}
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/BindRequestListenerTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php
similarity index 91%
rename from vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/BindRequestListenerTest.php
rename to vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php
index a3d235f..bfb9afa 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/BindRequestListenerTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php
@@ -9,11 +9,11 @@
* file that was distributed with this source code.
*/
-namespace Symfony\Component\Form\Tests\Extension\Core\EventListener;
+namespace Symfony\Component\Form\Tests\Extension\HttpFoundation\EventListener;
-use Symfony\Component\Form\Extension\Core\EventListener\BindRequestListener;
+use Symfony\Component\Form\Extension\HttpFoundation\EventListener\BindRequestListener;
use Symfony\Component\Form\Form;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\File\UploadedFile;
@@ -96,7 +96,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$form = new Form($config);
$event = new FormEvent($form, $request);
@@ -123,7 +123,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('', null, $dispatcher);
+ $config = new FormConfigBuilder('', null, $dispatcher);
$form = new Form($config);
$event = new FormEvent($form, $request);
@@ -150,7 +150,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$config->setCompound(true);
$config->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface'));
$form = new Form($config);
@@ -177,7 +177,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$config->setCompound(false);
$form = new Form($config);
$event = new FormEvent($form, $request);
@@ -201,7 +201,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$form = new Form($config);
$event = new FormEvent($form, $request);
@@ -225,7 +225,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('', null, $dispatcher);
+ $config = new FormConfigBuilder('', null, $dispatcher);
$form = new Form($config);
$event = new FormEvent($form, $request);
@@ -249,7 +249,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$config->setCompound(true);
$config->setDataMapper($this->getMock('Symfony\Component\Form\DataMapperInterface'));
$form = new Form($config);
@@ -272,7 +272,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase
));
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
- $config = new FormConfig('author', null, $dispatcher);
+ $config = new FormConfigBuilder('author', null, $dispatcher);
$config->setCompound(false);
$form = new Form($config);
$event = new FormEvent($form, $request);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php
index 03872b2..77767d2 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php
@@ -15,7 +15,7 @@ use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper;
use Symfony\Component\Form\Exception\TransformationFailedException;
use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Form;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\Util\PropertyPath;
use Symfony\Component\Validator\ConstraintViolation;
@@ -67,7 +67,7 @@ class ViolationMapperTest extends \PHPUnit_Framework_TestCase
protected function getForm($name = 'name', $propertyPath = null, $dataClass = null, $errorMapping = array(), $virtual = false, $synchronized = true)
{
- $config = new FormConfig($name, $dataClass, $this->dispatcher, array(
+ $config = new FormConfigBuilder($name, $dataClass, $this->dispatcher, array(
'error_mapping' => $errorMapping,
));
$config->setMapped(true);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php
new file mode 100644
index 0000000..e53d19f
--- /dev/null
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/Fixtures/AlternatingRowType.php
@@ -0,0 +1,27 @@
+getFormFactory();
+
+ $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($formFactory) {
+ $form = $event->getForm();
+ $type = $form->getName() % 2 === 0 ? 'text' : 'textarea';
+ $form->add($formFactory->createNamed('title', $type));
+ });
+ }
+
+ public function getName()
+ {
+ return 'alternating_row';
+ }
+}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormConfigTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormConfigTest.php
index 5896dc5..e11561a 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormConfigTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormConfigTest.php
@@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Tests;
/**
* @author Bernhard Schussek
*/
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
class FormConfigTest extends \PHPUnit_Framework_TestCase
{
@@ -64,7 +64,7 @@ class FormConfigTest extends \PHPUnit_Framework_TestCase
$dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
try {
- new FormConfig($name, null, $dispatcher);
+ new FormConfigBuilder($name, null, $dispatcher);
if (!$accepted) {
$this->fail(sprintf('The value "%s" should not be accepted', $name));
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormFactoryTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormFactoryTest.php
index 6165fb9..0cbf54c 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormFactoryTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormFactoryTest.php
@@ -44,6 +44,11 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
*/
private $registry;
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject
+ */
+ private $resolvedTypeFactory;
+
/**
* @var FormFactory
*/
@@ -55,10 +60,11 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
+ $this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactoryInterface');
$this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->registry = $this->getMock('Symfony\Component\Form\FormRegistryInterface');
- $this->factory = new FormFactory($this->registry);
+ $this->factory = new FormFactory($this->registry, $this->resolvedTypeFactory);
$this->registry->expects($this->any())
->method('getTypeGuesser')
@@ -73,8 +79,8 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
$type = new FooType();
$resolvedType = $this->getMockResolvedType();
- $this->registry->expects($this->once())
- ->method('resolveType')
+ $this->resolvedTypeFactory->expects($this->once())
+ ->method('createResolvedType')
->with($type)
->will($this->returnValue($resolvedType));
@@ -136,16 +142,11 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
$type = $this->getMockType();
$resolvedType = $this->getMockResolvedType();
- $this->registry->expects($this->once())
- ->method('resolveType')
+ $this->resolvedTypeFactory->expects($this->once())
+ ->method('createResolvedType')
->with($type)
->will($this->returnValue($resolvedType));
- // The type is also implicitely added to the registry
- $this->registry->expects($this->once())
- ->method('addType')
- ->with($resolvedType);
-
$resolvedType->expects($this->once())
->method('createBuilder')
->with($this->factory, 'name', $options)
@@ -159,11 +160,6 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
$options = array('a' => '1', 'b' => '2');
$resolvedType = $this->getMockResolvedType();
- // The type is also implicitely added to the registry
- $this->registry->expects($this->once())
- ->method('addType')
- ->with($resolvedType);
-
$resolvedType->expects($this->once())
->method('createBuilder')
->with($this->factory, 'name', $options)
@@ -555,7 +551,7 @@ class FormFactoryTest extends \PHPUnit_Framework_TestCase
{
return $this->getMockBuilder('Symfony\Component\Form\FormFactory')
->setMethods($methods)
- ->setConstructorArgs(array($this->registry))
+ ->setConstructorArgs(array($this->registry, $this->resolvedTypeFactory))
->getMock();
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php
index fa03a40..bdb93e1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Form\Tests;
use Symfony\Component\Form\FormFactory;
+use Symfony\Component\Form\ResolvedFormTypeFactory;
use Symfony\Component\Form\FormRegistry;
use Symfony\Component\Form\Extension\Core\CoreExtension;
@@ -20,6 +21,11 @@ use Symfony\Component\Form\Extension\Core\CoreExtension;
*/
class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
{
+ /**
+ * @var ResolvedFormTypeFactory
+ */
+ protected $resolvedTypeFactory;
+
/**
* @var FormRegistry
*/
@@ -36,8 +42,9 @@ class FormIntegrationTestCase extends \PHPUnit_Framework_TestCase
$this->markTestSkipped('The "EventDispatcher" component is not available');
}
- $this->registry = new FormRegistry($this->getExtensions());
- $this->factory = new FormFactory($this->registry);
+ $this->resolvedTypeFactory = new ResolvedFormTypeFactory();
+ $this->registry = new FormRegistry($this->getExtensions(), $this->resolvedTypeFactory);
+ $this->factory = new FormFactory($this->registry, $this->resolvedTypeFactory);
}
protected function getExtensions()
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormRegistryTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormRegistryTest.php
index ae0946f..e0a22da 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormRegistryTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/FormRegistryTest.php
@@ -27,6 +27,11 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
*/
private $registry;
+ /**
+ * @var \PHPUnit_Framework_MockObject_MockObject
+ */
+ private $resolvedTypeFactory;
+
/**
* @var \PHPUnit_Framework_MockObject_MockObject
*/
@@ -49,6 +54,7 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
+ $this->resolvedTypeFactory = $this->getMock('Symfony\Component\Form\ResolvedFormTypeFactory');
$this->guesser1 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->guesser2 = $this->getMock('Symfony\Component\Form\FormTypeGuesserInterface');
$this->extension1 = new TestExtension($this->guesser1);
@@ -56,53 +62,16 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
$this->registry = new FormRegistry(array(
$this->extension1,
$this->extension2,
- ));
- }
-
- public function testResolveType()
- {
- $type = new FooType();
- $ext1 = new FooTypeBarExtension();
- $ext2 = new FooTypeBazExtension();
-
- $this->extension1->addTypeExtension($ext1);
- $this->extension2->addTypeExtension($ext2);
-
- $resolvedType = $this->registry->resolveType($type);
-
- $this->assertEquals($type, $resolvedType->getInnerType());
- $this->assertEquals(array($ext1, $ext2), $resolvedType->getTypeExtensions());
- }
-
- public function testResolveTypeConnectsParent()
- {
- $parentType = new FooType();
- $type = new FooSubType();
-
- $resolvedParentType = $this->registry->resolveType($parentType);
-
- $this->registry->addType($resolvedParentType);
-
- $resolvedType = $this->registry->resolveType($type);
-
- $this->assertSame($resolvedParentType, $resolvedType->getParent());
- }
-
- /**
- * @expectedException Symfony\Component\Form\Exception\FormException
- */
- public function testResolveTypeThrowsExceptionIfParentNotFound()
- {
- $type = new FooSubType();
-
- $this->registry->resolveType($type);
+ ), $this->resolvedTypeFactory);
}
public function testGetTypeReturnsAddedType()
{
- $type = new FooType();
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
- $resolvedType = $this->registry->resolveType($type);
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
$this->registry->addType($resolvedType);
@@ -112,13 +81,88 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
public function testGetTypeFromExtension()
{
$type = new FooType();
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
$this->extension2->addType($type);
+ $this->resolvedTypeFactory->expects($this->once())
+ ->method('createResolvedType')
+ ->with($type)
+ ->will($this->returnValue($resolvedType));
+
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
+
$resolvedType = $this->registry->getType('foo');
- $this->assertInstanceOf('Symfony\Component\Form\ResolvedFormTypeInterface', $resolvedType);
- $this->assertSame($type, $resolvedType->getInnerType());
+ $this->assertSame($resolvedType, $this->registry->getType('foo'));
+ }
+
+ public function testGetTypeWithTypeExtensions()
+ {
+ $type = new FooType();
+ $ext1 = new FooTypeBarExtension();
+ $ext2 = new FooTypeBazExtension();
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
+
+ $this->extension2->addType($type);
+ $this->extension1->addTypeExtension($ext1);
+ $this->extension2->addTypeExtension($ext2);
+
+ $this->resolvedTypeFactory->expects($this->once())
+ ->method('createResolvedType')
+ ->with($type, array($ext1, $ext2))
+ ->will($this->returnValue($resolvedType));
+
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
+
+ $this->assertSame($resolvedType, $this->registry->getType('foo'));
+ }
+
+ public function testGetTypeConnectsParent()
+ {
+ $parentType = new FooType();
+ $type = new FooSubType();
+ $parentResolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
+
+ $this->extension1->addType($parentType);
+ $this->extension2->addType($type);
+
+ $this->resolvedTypeFactory->expects($this->at(0))
+ ->method('createResolvedType')
+ ->with($parentType)
+ ->will($this->returnValue($parentResolvedType));
+
+ $this->resolvedTypeFactory->expects($this->at(1))
+ ->method('createResolvedType')
+ ->with($type, array(), $parentResolvedType)
+ ->will($this->returnValue($resolvedType));
+
+ $parentResolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
+
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo_sub_type'));
+
+ $this->assertSame($resolvedType, $this->registry->getType('foo_sub_type'));
+ }
+
+ /**
+ * @expectedException Symfony\Component\Form\Exception\FormException
+ */
+ public function testGetTypeThrowsExceptionIfParentNotFound()
+ {
+ $type = new FooSubType();
+
+ $this->extension1->addType($type);
+
+ $this->registry->getType($type);
}
/**
@@ -139,9 +183,11 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
public function testHasTypeAfterAdding()
{
- $type = new FooType();
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
- $resolvedType = $this->registry->resolveType($type);
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
$this->assertFalse($this->registry->hasType('foo'));
@@ -153,6 +199,16 @@ class FormRegistryTest extends \PHPUnit_Framework_TestCase
public function testHasTypeAfterLoadingFromExtension()
{
$type = new FooType();
+ $resolvedType = $this->getMock('Symfony\Component\Form\ResolvedFormTypeInterface');
+
+ $this->resolvedTypeFactory->expects($this->once())
+ ->method('createResolvedType')
+ ->with($type)
+ ->will($this->returnValue($resolvedType));
+
+ $resolvedType->expects($this->any())
+ ->method('getName')
+ ->will($this->returnValue('foo'));
$this->assertFalse($this->registry->hasType('foo'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php
index 2aded4f..e543de5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/ResolvedFormTypeTest.php
@@ -14,7 +14,7 @@ namespace Symfony\Component\Form\Tests;
use Symfony\Component\Form\ResolvedFormType;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormBuilder;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\Form;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/SimpleFormTest.php
index afebeda..2ca9c26 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/SimpleFormTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Tests/SimpleFormTest.php
@@ -15,7 +15,7 @@ use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\Util\PropertyPath;
-use Symfony\Component\Form\FormConfig;
+use Symfony\Component\Form\FormConfigBuilder;
use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\Exception\TransformationFailedException;
@@ -34,7 +34,7 @@ class SimpleFormTest extends AbstractFormTest
'foo' => 'bar',
));
- $config = new FormConfig('name', null, $this->dispatcher);
+ $config = new FormConfigBuilder('name', null, $this->dispatcher);
$config->addViewTransformer($view);
$config->addModelTransformer($model);
$config->setData('default');
@@ -45,6 +45,28 @@ class SimpleFormTest extends AbstractFormTest
$this->assertSame('bar', $form->getViewData());
}
+ // https://github.com/symfony/symfony/commit/d4f4038f6daf7cf88ca7c7ab089473cce5ebf7d8#commitcomment-1632879
+ public function testDataIsInitializedFromBind()
+ {
+ $mock = $this->getMockBuilder('\stdClass')
+ ->setMethods(array('preSetData', 'preBind'))
+ ->getMock();
+ $mock->expects($this->at(0))
+ ->method('preSetData');
+ $mock->expects($this->at(1))
+ ->method('preBind');
+
+ $config = new FormConfigBuilder('name', null, $this->dispatcher);
+ $config->addEventListener(FormEvents::PRE_SET_DATA, array($mock, 'preSetData'));
+ $config->addEventListener(FormEvents::PRE_BIND, array($mock, 'preBind'));
+ $form = new Form($config);
+
+ // no call to setData() or similar where the object would be
+ // initialized otherwise
+
+ $form->bind('foobar');
+ }
+
/**
* @expectedException Symfony\Component\Form\Exception\AlreadyBoundException
*/
@@ -694,7 +716,7 @@ class SimpleFormTest extends AbstractFormTest
*/
public function testViewDataMustNotBeObjectIfDataClassIsNull()
{
- $config = new FormConfig('name', null, $this->dispatcher);
+ $config = new FormConfigBuilder('name', null, $this->dispatcher);
$config->addViewTransformer(new FixedDataTransformer(array(
'' => '',
'foo' => new \stdClass(),
@@ -707,7 +729,7 @@ class SimpleFormTest extends AbstractFormTest
public function testViewDataMayBeArrayAccessIfDataClassIsNull()
{
$arrayAccess = $this->getMock('\ArrayAccess');
- $config = new FormConfig('name', null, $this->dispatcher);
+ $config = new FormConfigBuilder('name', null, $this->dispatcher);
$config->addViewTransformer(new FixedDataTransformer(array(
'' => '',
'foo' => $arrayAccess,
@@ -724,7 +746,7 @@ class SimpleFormTest extends AbstractFormTest
*/
public function testViewDataMustBeObjectIfDataClassIsSet()
{
- $config = new FormConfig('name', 'stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', 'stdClass', $this->dispatcher);
$config->addViewTransformer(new FixedDataTransformer(array(
'' => '',
'foo' => array('bar' => 'baz'),
@@ -740,7 +762,7 @@ class SimpleFormTest extends AbstractFormTest
public function testSetDataCannotInvokeItself()
{
// Cycle detection to prevent endless loops
- $config = new FormConfig('name', 'stdClass', $this->dispatcher);
+ $config = new FormConfigBuilder('name', 'stdClass', $this->dispatcher);
$config->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
$event->getForm()->setData('bar');
});
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPath.php b/vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPath.php
index 6d2c896..482d7eb 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPath.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Form/Util/PropertyPath.php
@@ -587,9 +587,9 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
* Searches for add and remove methods.
*
* @param \ReflectionClass $reflClass The reflection class for the given object
- * @param string|null $singular The singular form of the property name or null.
+ * @param string|null $singulars The singular form of the property name or null.
*
- * @return array|null An array containin the adder and remover when found, null otherwise.
+ * @return array|null An array containing the adder and remover when found, null otherwise.
*
* @throws InvalidPropertyException If the property does not exist.
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RedirectResponse.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RedirectResponse.php
index f2e854e..a9d98e6 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RedirectResponse.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RedirectResponse.php
@@ -39,24 +39,9 @@ class RedirectResponse extends Response
throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
}
- $this->targetUrl = $url;
+ parent::__construct('', $status, $headers);
- parent::__construct(
- sprintf('
-
-
-
-
-
- Redirecting to %1$s
-
-
- Redirecting to %1$s.
-
-', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')),
- $status,
- array_merge($headers, array('Location' => $url))
- );
+ $this->setTargetUrl($url);
if (!$this->isRedirect()) {
throw new \InvalidArgumentException(sprintf('The HTTP status code is not a redirect ("%s" given).', $status));
@@ -80,4 +65,38 @@ class RedirectResponse extends Response
{
return $this->targetUrl;
}
+
+ /**
+ * Sets the redirect target of this response.
+ *
+ * @param string $url The URL to redirect to
+ *
+ * @return RedirectResponse The current response.
+ */
+ public function setTargetUrl($url)
+ {
+ if (empty($url)) {
+ throw new \InvalidArgumentException('Cannot redirect to an empty URL.');
+ }
+
+ $this->targetUrl = $url;
+
+ $this->setContent(
+ sprintf('
+
+
+
+
+
+ Redirecting to %1$s
+
+
+ Redirecting to %1$s.
+
+', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));
+
+ $this->headers->set('Location', $url);
+
+ return $this;
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Request.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Request.php
index 8d681a9..848c3d1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Request.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Request.php
@@ -515,7 +515,7 @@ class Request
* * slow
* * prefer to get from a "named" source
*
- * It is better to explicity get request parameters from the appropriate
+ * It is better to explicitly get request parameters from the appropriate
* public property instead (query, request, attributes, ...).
*
* @param string $key the key
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcher.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcher.php
index 072c520..2982952 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcher.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/RequestMatcher.php
@@ -202,7 +202,16 @@ class RequestMatcher implements RequestMatcherInterface
throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
}
- list($address, $netmask) = explode('/', $ip, 2);
+ if (false !== strpos($ip, '/')) {
+ list($address, $netmask) = explode('/', $ip, 2);
+
+ if ($netmask < 1 || $netmask > 128) {
+ return false;
+ }
+ } else {
+ $address = $ip;
+ $netmask = 128;
+ }
$bytesAddr = unpack("n*", inet_pton($address));
$bytesTest = unpack("n*", inet_pton($requestIp));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php
index 7ab2014..dbc82d1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php
@@ -303,9 +303,12 @@ class Response
// ob_get_level() never returns 0 on some Windows configurations, so if
// the level is the same two times in a row, the loop should be stopped.
$previous = null;
+ $obStatus = ob_get_status(1);
while (($level = ob_get_level()) > 0 && $level !== $previous) {
$previous = $level;
- ob_end_flush();
+ if ($obStatus[$level - 1] && isset($obStatus[$level - 1]['del']) && $obStatus[$level - 1]['del']) {
+ ob_end_flush();
+ }
}
flush();
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
index ec753ec..ecc68ad 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
@@ -173,7 +173,7 @@ class NativeSessionStorage implements SessionStorageInterface
*/
public function setId($id)
{
- return $this->saveHandler->setId($id);
+ $this->saveHandler->setId($id);
}
/**
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
index 179ee5a..b55c3b6 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RedirectResponseTest.php
@@ -40,6 +40,14 @@ class RedirectResponseTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('foo.bar', $response->getTargetUrl());
}
+ public function testSetTargetUrl()
+ {
+ $response = new RedirectResponse('foo.bar');
+ $response->setTargetUrl('baz.beep');
+
+ $this->assertEquals('baz.beep', $response->getTargetUrl());
+ }
+
public function testCreate()
{
$response = RedirectResponse::create('foo', 301);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php
index e165987..32ca1e5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php
@@ -62,6 +62,9 @@ class RequestMatcherTest extends \PHPUnit_Framework_TestCase
return array(
array(true, '2a01:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'),
array(false, '2a00:198:603:0:396e:4789:8e99:890f', '2a01:198:603:0::/65'),
+ array(false, '2a01:198:603:0:396e:4789:8e99:890f', '::1'),
+ array(true, '0:0:0:0:0:0:0:1', '::1'),
+ array(false, '0:0:603:0:396e:4789:8e99:0001', '::1'),
);
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
index 07b2780..80e250a 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php
@@ -60,7 +60,7 @@ class RouterDataCollector extends DataCollector
/**
* Remembers the controller associated to each request.
*
- * @param FilterControllerEvent The filter controller event
+ * @param FilterControllerEvent $event The filter controller event
*/
public function onKernelController(FilterControllerEvent $event)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php
index 848f3cc..c0133d4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Debug/ExceptionHandler.php
@@ -43,7 +43,7 @@ class ExceptionHandler
/**
* Register the exception handler.
*
- * @return The registered exception handler
+ * @return ExceptionHandler The registered exception handler
*/
public static function register($debug = true)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php
index 6848f78..caa7b9f 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Event/PostResponseEvent.php
@@ -61,7 +61,7 @@ class PostResponseEvent extends Event
}
/**
- * Returns the reponse for which this event was thrown.
+ * Returns the response for which this event was thrown.
*
* @return Response
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelEvents.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelEvents.php
index c2a4309..fce48ac 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelEvents.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/KernelEvents.php
@@ -93,7 +93,7 @@ final class KernelEvents
const RESPONSE = 'kernel.response';
/**
- * The TERMINATE event occurs once a reponse was sent
+ * The TERMINATE event occurs once a response was sent
*
* This event allows you to run expensive post-response jobs.
* The event listener method receives a
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
index dfab9a6..94052f8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php
@@ -205,7 +205,7 @@ class FileProfilerStorage implements ProfilerStorageInterface
*
* @param resource $file The file resource, with the pointer placed at the end of the line to read
*
- * @return mixed A string representating the line or FALSE if beginning of file is reached
+ * @return mixed A string representing the line or FALSE if beginning of file is reached
*/
protected function readLineFromFile($file)
{
diff --git a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
index ec8ad1f..51c9f9c 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php
@@ -370,7 +370,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
/**
* Removes the specified keys.
*
- * @param array $key
+ * @param array $keys
*
* @return Boolean
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntl.php b/vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntl.php
index b89e52f..07e45b8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntl.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Locale/Stub/StubIntl.php
@@ -104,6 +104,8 @@ abstract class StubIntl
/**
* Returns the symbolic name for a given error code
*
+ * @param integer $code The error code returned by StubIntl::getErrorCode()
+ *
* @return string
*/
public static function getErrorName($code)
diff --git a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/LazyOption.php b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/LazyOption.php
deleted file mode 100644
index fbe700a..0000000
--- a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/LazyOption.php
+++ /dev/null
@@ -1,73 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\OptionsResolver;
-
-/**
- * An option that is evaluated lazily using a closure.
- *
- * @author Bernhard Schussek
- */
-class LazyOption
-{
- /**
- * The underlying closure.
- * @var \Closure
- */
- private $closure;
-
- /**
- * The previous default value of the option.
- * @var mixed
- */
- private $previousValue;
-
- /**
- * Creates a new lazy option.
- *
- * @param \Closure $closure The closure used for initializing the
- * option value.
- * @param mixed $previousValue The previous value of the option. This
- * value is passed to the closure when it is
- * evaluated.
- *
- * @see evaluate()
- */
- public function __construct(\Closure $closure, $previousValue = null)
- {
- $this->closure = $closure;
- $this->previousValue = $previousValue;
- }
-
- /**
- * Evaluates the underlying closure and returns its result.
- *
- * The given Options instance is passed to the closure as first argument.
- * The previous default value set in the constructor is passed as second
- * argument.
- *
- * @param Options $options The container with all concrete options.
- *
- * @return mixed The result of the closure.
- */
- public function evaluate(Options $options)
- {
- $previousValue = $this->previousValue;
- $closure = $this->closure;
-
- if ($previousValue instanceof self) {
- $previousValue = $this->previousValue->evaluate($options);
- }
-
- // Performs a bit better than __invoke() and call_user_func()
- return $closure($options, $previousValue);
- }
-}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Options.php b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Options.php
index 575faa0..ef10a19 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Options.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Options.php
@@ -21,19 +21,25 @@ use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException;
class Options implements \ArrayAccess, \Iterator, \Countable
{
/**
- * A list of option values and LazyOption instances.
+ * A list of option values.
* @var array
*/
private $options = array();
/**
- * A list storing the names of all LazyOption instances as keys.
+ * A list of normalizer closures.
+ * @var array
+ */
+ private $normalizers = array();
+
+ /**
+ * A list of closures for evaluating lazy options.
* @var array
*/
private $lazy = array();
/**
- * A list of Boolean locks for each LazyOption.
+ * A list containing the currently locked options.
* @var array
*/
private $lock = array();
@@ -83,10 +89,40 @@ class Options implements \ArrayAccess, \Iterator, \Countable
// Setting is equivalent to overloading while discarding the previous
// option value
unset($this->options[$option]);
+ unset($this->lazy[$option]);
$this->overload($option, $value);
}
+ /**
+ * Sets the normalizer for a given option.
+ *
+ * Normalizers should be closures with the following signature:
+ *
+ *
+ * function (Options $options, $value)
+ *
+ *
+ * This closure will be evaluated once the option is read using
+ * {@link get()}. The closure has access to the resolved values of
+ * other options through the passed {@link Options} instance.
+ *
+ * @param string $option The name of the option.
+ * @param \Closure $normalizer The normalizer.
+ *
+ * @throws OptionDefinitionException If options have already been read.
+ * Once options are read, the container
+ * becomes immutable.
+ */
+ public function setNormalizer($option, \Closure $normalizer)
+ {
+ if ($this->reading) {
+ throw new OptionDefinitionException('Normalizers cannot be added anymore once options have been read.');
+ }
+
+ $this->normalizers[$option] = $normalizer;
+ }
+
/**
* Replaces the contents of the container with the given options.
*
@@ -106,9 +142,10 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
$this->options = array();
+ $this->lazy = array();
foreach ($options as $option => $value) {
- $this->set($option, $value);
+ $this->overload($option, $value);
}
}
@@ -140,29 +177,30 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
// If an option is a closure that should be evaluated lazily, store it
- // inside a LazyOption instance.
+ // in the "lazy" property.
if ($value instanceof \Closure) {
$reflClosure = new \ReflectionFunction($value);
$params = $reflClosure->getParameters();
if (isset($params[0]) && null !== ($class = $params[0]->getClass()) && __CLASS__ === $class->name) {
- $currentValue = isset($this->options[$option]) ? $this->options[$option] : null;
- $value = new LazyOption($value, $currentValue);
+ // Initialize the option if no previous value exists
+ if (!isset($this->options[$option])) {
+ $this->options[$option] = null;
+ }
- // Store locks for lazy options to detect cyclic dependencies
- $this->lock[$option] = false;
+ // Ignore previous lazy options if the closure has no second parameter
+ if (!isset($this->lazy[$option]) || !isset($params[1])) {
+ $this->lazy[$option] = array();
+ }
- // Store which options are lazy for more efficient resolving
- $this->lazy[$option] = true;
-
- $this->options[$option] = $value;
+ // Store closure for later evaluation
+ $this->lazy[$option][] = $value;
return;
}
}
- // Reset lazy flag and locks by default
- unset($this->lock[$option]);
+ // Remove lazy options by default
unset($this->lazy[$option]);
$this->options[$option] = $value;
@@ -193,6 +231,10 @@ class Options implements \ArrayAccess, \Iterator, \Countable
$this->resolve($option);
}
+ if (isset($this->normalizers[$option])) {
+ $this->normalize($option);
+ }
+
return $this->options[$option];
}
@@ -205,7 +247,7 @@ class Options implements \ArrayAccess, \Iterator, \Countable
*/
public function has($option)
{
- return isset($this->options[$option]);
+ return array_key_exists($option, $this->options);
}
/**
@@ -224,8 +266,8 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
unset($this->options[$option]);
- unset($this->lock[$option]);
unset($this->lazy[$option]);
+ unset($this->normalizers[$option]);
}
/**
@@ -242,8 +284,8 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
$this->options = array();
- $this->lock = array();
$this->lazy = array();
+ $this->normalizers = array();
}
/**
@@ -257,19 +299,22 @@ class Options implements \ArrayAccess, \Iterator, \Countable
{
$this->reading = true;
- // Create a copy because resolve() modifies the array
- $lazy = $this->lazy;
-
// Performance-wise this is slightly better than
// while (null !== $option = key($this->lazy))
- foreach ($lazy as $option => $isLazy) {
- // When resolve() is called, potentially multiple lazy options
- // are evaluated, so check again if the option is still lazy.
+ foreach ($this->lazy as $option => $closures) {
+ // Double check, in case the option has already been resolved
+ // by cascade in the previous cycles
if (isset($this->lazy[$option])) {
$this->resolve($option);
}
}
+ foreach ($this->normalizers as $option => $normalizer) {
+ if (isset($this->normalizers[$option])) {
+ $this->normalize($option);
+ }
+ }
+
return $this->options;
}
@@ -388,7 +433,7 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
/**
- * Evaluates the given option if it is a lazy option.
+ * Evaluates the given lazy option.
*
* The evaluated value is written into the options array. The closure for
* evaluating the option is discarded afterwards.
@@ -400,7 +445,11 @@ class Options implements \ArrayAccess, \Iterator, \Countable
*/
private function resolve($option)
{
- if ($this->lock[$option]) {
+ // The code duplication with normalize() exists for performance
+ // reasons, in order to save a method call.
+ // Remember that this method is potentially called a couple of thousand
+ // times and needs to be as efficient as possible.
+ if (isset($this->lock[$option])) {
$conflicts = array();
foreach ($this->lock as $option => $locked) {
@@ -413,10 +462,51 @@ class Options implements \ArrayAccess, \Iterator, \Countable
}
$this->lock[$option] = true;
- $this->options[$option] = $this->options[$option]->evaluate($this);
- $this->lock[$option] = false;
+ foreach ($this->lazy[$option] as $closure) {
+ $this->options[$option] = $closure($this, $this->options[$option]);
+ }
+ unset($this->lock[$option]);
// The option now isn't lazy anymore
unset($this->lazy[$option]);
}
+
+ /**
+ * Normalizes the given option.
+ *
+ * The evaluated value is written into the options array.
+ *
+ * @param string $option The option to normalizer.
+ *
+ * @throws OptionDefinitionException If the option has a cyclic dependency
+ * on another option.
+ */
+ private function normalize($option)
+ {
+ // The code duplication with resolve() exists for performance
+ // reasons, in order to save a method call.
+ // Remember that this method is potentially called a couple of thousand
+ // times and needs to be as efficient as possible.
+ if (isset($this->lock[$option])) {
+ $conflicts = array();
+
+ foreach ($this->lock as $option => $locked) {
+ if ($locked) {
+ $conflicts[] = $option;
+ }
+ }
+
+ throw new OptionDefinitionException('The options "' . implode('", "', $conflicts) . '" have a cyclic dependency.');
+ }
+
+ /** @var \Closure $normalizer */
+ $normalizer = $this->normalizers[$option];
+
+ $this->lock[$option] = true;
+ $this->options[$option] = $normalizer($this, $this->options[$option]);
+ unset($this->lock[$option]);
+
+ // The option is now normalized
+ unset($this->normalizers[$option]);
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php
index fdddad6..20ec7af 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/OptionsResolver.php
@@ -53,12 +53,6 @@ class OptionsResolver implements OptionsResolverInterface
*/
private $allowedTypes = array();
- /**
- * A list of normalizers transforming each resolved options.
- * @var array
- */
- private $normalizers = array();
-
/**
* Creates a new instance.
*/
@@ -194,7 +188,9 @@ class OptionsResolver implements OptionsResolverInterface
{
$this->validateOptionsExistence($normalizers);
- $this->normalizers = array_replace($this->normalizers, $normalizers);
+ foreach ($normalizers as $option => $normalizer) {
+ $this->defaultOptions->setNormalizer($option, $normalizer);
+ }
return $this;
}
@@ -231,11 +227,6 @@ class OptionsResolver implements OptionsResolverInterface
$combinedOptions->set($option, $value);
}
- // Apply filters
- foreach ($this->normalizers as $option => $filter) {
- $combinedOptions->overload($option, $filter);
- }
-
// Resolve options
$resolvedOptions = $combinedOptions->all();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/LazyOptionTest.php b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/LazyOptionTest.php
deleted file mode 100644
index 48b15ce..0000000
--- a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/LazyOptionTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Symfony\Component\OptionsResolver\Tests;
-
-use Symfony\Component\OptionsResolver\LazyOption;
-use Symfony\Component\OptionsResolver\Options;
-
-/**
- * @author Bernhard Schussek
- */
-class LazyOptionTest extends \PHPUnit_Framework_TestCase
-{
- public function testDontCacheEvaluatedPreviousValue()
- {
- $previousValue = new LazyOption(function (Options $options) {
- return $options['foo'];
- });
-
- $lazyOption = new LazyOption(function (Options $options, $previousValue) {
- return $previousValue;
- }, $previousValue);
-
- // If provided with two different option sets, two different results
- // should be returned
- $options1 = new Options();
- $options1['foo'] = 'bar';
-
- $this->assertSame('bar', $lazyOption->evaluate($options1));
-
- $options2 = new Options();
- $options2['foo'] = 'boo';
-
- $this->assertSame('boo', $lazyOption->evaluate($options2));
- }
-}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php
index ca0872f..e151051 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php
@@ -79,6 +79,16 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->options->remove('foo');
}
+ /**
+ * @expectedException Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testSetNormalizerNotSupportedAfterGet()
+ {
+ $this->options->set('foo', 'bar');
+ $this->options->get('foo');
+ $this->options->setNormalizer('foo', function () {});
+ }
+
public function testSetLazyOption()
{
$test = $this;
@@ -146,6 +156,23 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('dynamic', $this->options->get('foo'));
}
+ public function testPreviousValueIsNotEvaluatedIfNoSecondArgument()
+ {
+ $test = $this;
+
+ // defined by superclass
+ $this->options->set('foo', function (Options $options) use ($test) {
+ $test->fail('Should not be called');
+ });
+
+ // defined by subclass, no $previousValue argument defined!
+ $this->options->overload('foo', function (Options $options) use ($test) {
+ return 'dynamic';
+ });
+
+ $this->assertEquals('dynamic', $this->options->get('foo'));
+ }
+
public function testLazyOptionCanAccessOtherOptions()
{
$test = $this;
@@ -182,6 +209,66 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('dynamic', $this->options->get('bam'));
}
+ public function testNormalizer()
+ {
+ $this->options->set('foo', 'bar');
+
+ $this->options->setNormalizer('foo', function () {
+ return 'normalized';
+ });
+
+ $this->assertEquals('normalized', $this->options->get('foo'));
+ }
+
+ public function testNormalizerReceivesUnnormalizedValue()
+ {
+ $this->options->set('foo', 'bar');
+
+ $this->options->setNormalizer('foo', function (Options $options, $value) {
+ return 'normalized[' . $value . ']';
+ });
+
+ $this->assertEquals('normalized[bar]', $this->options->get('foo'));
+ }
+
+ public function testNormalizerCanAccessOtherOptions()
+ {
+ $test = $this;
+
+ $this->options->set('foo', 'bar');
+ $this->options->set('bam', 'baz');
+
+ $this->options->setNormalizer('bam', function (Options $options) use ($test) {
+ /* @var \PHPUnit_Framework_TestCase $test */
+ $test->assertEquals('bar', $options->get('foo'));
+
+ return 'normalized';
+ });
+
+ $this->assertEquals('bar', $this->options->get('foo'));
+ $this->assertEquals('normalized', $this->options->get('bam'));
+ }
+
+ public function testNormalizerCanAccessOtherLazyOptions()
+ {
+ $test = $this;
+
+ $this->options->set('foo', function (Options $options) {
+ return 'bar';
+ });
+ $this->options->set('bam', 'baz');
+
+ $this->options->setNormalizer('bam', function (Options $options) use ($test) {
+ /* @var \PHPUnit_Framework_TestCase $test */
+ $test->assertEquals('bar', $options->get('foo'));
+
+ return 'normalized';
+ });
+
+ $this->assertEquals('bar', $this->options->get('foo'));
+ $this->assertEquals('normalized', $this->options->get('bam'));
+ }
+
/**
* @expectedException Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
*/
@@ -198,6 +285,85 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->options->get('foo');
}
+ /**
+ * @expectedException Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailForCyclicDependenciesBetweenNormalizers()
+ {
+ $this->options->set('foo', 'bar');
+ $this->options->set('bam', 'baz');
+
+ $this->options->setNormalizer('foo', function (Options $options) {
+ $options->get('bam');
+ });
+
+ $this->options->setNormalizer('bam', function (Options $options) {
+ $options->get('foo');
+ });
+
+ $this->options->get('foo');
+ }
+
+ /**
+ * @expectedException Symfony\Component\OptionsResolver\Exception\OptionDefinitionException
+ */
+ public function testFailForCyclicDependenciesBetweenNormalizerAndLazyOption()
+ {
+ $this->options->set('foo', function (Options $options) {
+ $options->get('bam');
+ });
+ $this->options->set('bam', 'baz');
+
+ $this->options->setNormalizer('bam', function (Options $options) {
+ $options->get('foo');
+ });
+
+ $this->options->get('foo');
+ }
+
+ public function testAllInvokesEachLazyOptionOnlyOnce()
+ {
+ $test = $this;
+ $i = 1;
+
+ $this->options->set('foo', function (Options $options) use ($test, &$i) {
+ $test->assertSame(1, $i);
+ ++$i;
+
+ // Implicitly invoke lazy option for "bam"
+ $options->get('bam');
+ });
+ $this->options->set('bam', function (Options $options) use ($test, &$i) {
+ $test->assertSame(2, $i);
+ ++$i;
+ });
+
+ $this->options->all();
+ }
+
+ public function testAllInvokesEachNormalizerOnlyOnce()
+ {
+ $test = $this;
+ $i = 1;
+
+ $this->options->set('foo', 'bar');
+ $this->options->set('bam', 'baz');
+
+ $this->options->setNormalizer('foo', function (Options $options) use ($test, &$i) {
+ $test->assertSame(1, $i);
+ ++$i;
+
+ // Implicitly invoke normalizer for "bam"
+ $options->get('bam');
+ });
+ $this->options->setNormalizer('bam', function (Options $options) use ($test, &$i) {
+ $test->assertSame(2, $i);
+ ++$i;
+ });
+
+ $this->options->all();
+ }
+
public function testReplaceClearsAndSets()
{
$this->options->set('one', '1');
@@ -264,7 +430,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->options->clear();
}
- public function testOverloadCannotBeEvaluatedLazilyWithoutExpectedClousureParams()
+ public function testOverloadCannotBeEvaluatedLazilyWithoutExpectedClosureParams()
{
$this->options->set('foo', 'bar');
@@ -296,4 +462,11 @@ class OptionsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expectedResult, iterator_to_array($this->options, true));
}
+
+ public function testHasWithNullValue()
+ {
+ $this->options->set('foo', null);
+
+ $this->assertTrue($this->options->has('foo'));
+ }
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Process/Process.php b/vendor/symfony/symfony/src/Symfony/Component/Process/Process.php
index 6df07a1..9cd7c78 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Process/Process.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Process/Process.php
@@ -180,7 +180,7 @@ class Process
* the output in real-time while writing the standard input to the process.
* It allows to have feedback from the independent process during execution.
* If there is no callback passed, the wait() method can be called
- * with true as a second parameter then the callback will get all data occured
+ * with true as a second parameter then the callback will get all data occurred
* in (and since) the start call.
*
* @param Closure|string|array $callback A PHP callback to run whenever there is some
@@ -525,7 +525,7 @@ class Process
*
* @param float $timeout The timeout in seconds
*
- * @return int The exitcode of the process
+ * @return integer The exitcode of the process
*
* @throws \RuntimeException if the process got signaled
*/
@@ -662,8 +662,8 @@ class Process
/**
* Builds up the callback used by wait().
*
- * The callbacks adds all occured output to the specific buffer and calls
- * the usercallback (if present) with the received output.
+ * The callbacks adds all occurred output to the specific buffer and calls
+ * the user callback (if present) with the received output.
*
* @param mixed $callback The user defined PHP callback
*
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTest.php b/vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTest.php
index 81f8171..c54f5d8 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Process/Tests/ProcessTest.php
@@ -146,7 +146,7 @@ class ProcessTest extends \PHPUnit_Framework_TestCase
{
$this->markTestSkipped('Can course php to hang');
- // Sleep dont work as it will allow the process to handle signals and close
+ // Sleep doesn't work as it will allow the process to handle signals and close
// file handles from the other end.
$process = new Process('php -r "while (true) {}"');
$process->start();
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
index a8e0dcb..7213054 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
@@ -165,7 +165,7 @@ EOF;
/**
* Compiles a single Route to PHP code used to match it against the path info.
*
- * @param Route $routes A Route instance
+ * @param Route $route A Route instance
* @param string $name The name of the Route
* @param Boolean $supportsRedirections Whether redirections are supported by the base class
* @param string|null $parentPrefix The prefix of the parent collection used to optimize the code
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php
index b517907..c417d94 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Matcher/UrlMatcher.php
@@ -151,7 +151,7 @@ class UrlMatcher implements UrlMatcherInterface
*
* @param string $pathinfo The path
* @param string $name The route name
- * @param string $route The route
+ * @param Route $route The route
*
* @return array The first element represents the status, the second contains additional information
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCollection.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCollection.php
index 000dad0..7a0e4c9 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCollection.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/RouteCollection.php
@@ -308,7 +308,7 @@ class RouteCollection implements \IteratorAggregate, \Countable
{
// It is ensured by the adders (->add and ->addCollection) that there can
// only be one route per name in all connected collections. So we can stop
- // interating recursively on the first hit.
+ // iterating recursively on the first hit.
if (isset($this->routes[$name])) {
unset($this->routes[$name]);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
index 53e86fa..2558b2d 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php
@@ -139,9 +139,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
}
- // overriden
+ // overridden
if (preg_match('#^/a/(?.*)$#s', $pathinfo, $matches)) {
- $matches['_route'] = 'overriden';
+ $matches['_route'] = 'overridden';
return $matches;
}
@@ -171,9 +171,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
return array_merge($this->mergeDefaults($matches, array ( 'who' => 'World!',)), array('_route' => 'helloWorld'));
}
- // overriden2
+ // overridden2
if ($pathinfo === '/multi/new') {
- return array('_route' => 'overriden2');
+ return array('_route' => 'overridden2');
}
// hey
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
index a3c105c..ad1476e 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php
@@ -147,9 +147,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
}
- // overriden
+ // overridden
if (preg_match('#^/a/(?.*)$#s', $pathinfo, $matches)) {
- $matches['_route'] = 'overriden';
+ $matches['_route'] = 'overridden';
return $matches;
}
@@ -179,9 +179,9 @@ class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\Redirec
return array_merge($this->mergeDefaults($matches, array ( 'who' => 'World!',)), array('_route' => 'helloWorld'));
}
- // overriden2
+ // overridden2
if ($pathinfo === '/multi/new') {
- return array('_route' => 'overriden2');
+ return array('_route' => 'overridden2');
}
// hey
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
index 852de41..ab22ebd 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
@@ -191,7 +191,7 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase
/**
* @expectedException Symfony\Component\Routing\Exception\InvalidParameterException
*/
- public function testGenerateForRouteWithInvalidManditoryParameter()
+ public function testGenerateForRouteWithInvalidMandatoryParameter()
{
$routes = $this->getRoutes('test', new Route('/testing/{foo}', array(), array('foo' => 'd+')));
$this->getGenerator($routes)->generate('test', array('foo' => 'bar'), true);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php
index e4e107c..8848720 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php
@@ -17,6 +17,18 @@ use Symfony\Component\Routing\Matcher\ApacheUrlMatcher;
class ApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase
{
+ protected $server;
+
+ protected function setUp()
+ {
+ $this->server = $_SERVER;
+ }
+
+ protected function tearDown()
+ {
+ $_SERVER = $this->server;
+ }
+
/**
* @dataProvider getMatchData
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
index 69b3c07..ee11385 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php
@@ -50,7 +50,7 @@ class PhpMatcherDumperTest extends \PHPUnit_Framework_TestCase
$collection = new RouteCollection();
- $collection->add('overriden', new Route('/overriden'));
+ $collection->add('overridden', new Route('/overridden'));
// defaults and requirements
$collection->add('foo', new Route(
@@ -116,25 +116,25 @@ class PhpMatcherDumperTest extends \PHPUnit_Framework_TestCase
// prefixes
$collection1 = new RouteCollection();
- $collection1->add('overriden', new Route('/overriden1'));
+ $collection1->add('overridden', new Route('/overridden1'));
$collection1->add('foo1', new Route('/{foo}'));
$collection1->add('bar1', new Route('/{bar}'));
$collection2 = new RouteCollection();
$collection2->addCollection($collection1, '/b\'b');
- $collection2->add('overriden', new Route('/{var}', array(), array('var' => '.*')));
+ $collection2->add('overridden', new Route('/{var}', array(), array('var' => '.*')));
$collection1 = new RouteCollection();
$collection1->add('foo2', new Route('/{foo1}'));
$collection1->add('bar2', new Route('/{bar1}'));
$collection2->addCollection($collection1, '/b\'b');
$collection->addCollection($collection2, '/a');
- // overriden through addCollection() and multiple sub-collections with no own prefix
+ // overridden through addCollection() and multiple sub-collections with no own prefix
$collection1 = new RouteCollection();
- $collection1->add('overriden2', new Route('/old'));
+ $collection1->add('overridden2', new Route('/old'));
$collection1->add('helloWorld', new Route('/hello/{who}', array('who' => 'World!')));
$collection2 = new RouteCollection();
$collection3 = new RouteCollection();
- $collection3->add('overriden2', new Route('/new'));
+ $collection3->add('overridden2', new Route('/new'));
$collection3->add('hey', new Route('/hey/'));
$collection1->addCollection($collection2);
$collection2->addCollection($collection3);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
index 77d1f20..31069b2 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
@@ -178,7 +178,7 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(array('_route' => 'foo', 'foo' => "\n"), $matcher->match('/'.urlencode("\n").'/bar'), 'linefeed character is matched');
}
- public function testMatchOverridenRoute()
+ public function testMatchOverriddenRoute()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/foo'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php
index 6a31cdc..792e65d 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Routing/Tests/RouteCollectionTest.php
@@ -37,7 +37,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
$collection->add('f o o', $route);
}
- public function testOverridenRoute()
+ public function testOverriddenRoute()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/foo'));
@@ -46,7 +46,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('/foo1', $collection->get('foo')->getPattern());
}
- public function testDeepOverridenRoute()
+ public function testDeepOverriddenRoute()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/foo'));
@@ -64,7 +64,7 @@ class RouteCollectionTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('/foo2', $collection->get('foo')->getPattern());
}
- public function testIteratorWithOverridenRoutes()
+ public function testIteratorWithOverriddenRoutes()
{
$collection = new RouteCollection();
$collection->add('foo', new Route('/foo'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/Security/CHANGELOG.md
index 0093677..c570ac3 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/CHANGELOG.md
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/CHANGELOG.md
@@ -21,7 +21,7 @@ CHANGELOG
`UserSecurityIdentity::fromToken` now return correct identities for proxies
objects (e.g. Doctrine proxies)
* [BC BREAK] moved the default authentication success and failure handling to
- seperate classes. The order of arguments in the constructor of the
+ separate classes. The order of arguments in the constructor of the
`AbstractAuthenticationListener` has changed.
- * [BC BREAK] moved the default logout sucess handling to a seperate class. The
+ * [BC BREAK] moved the default logout success handling to a separate class. The
order of arguments in the constructor of `LogoutListener` has changed.
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/User.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/User.php
index 6076603..b378e1b 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/User.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Core/User/User.php
@@ -22,6 +22,7 @@ final class User implements AdvancedUserInterface
{
private $username;
private $password;
+ private $enabled;
private $accountNonExpired;
private $credentialsNonExpired;
private $accountNonLocked;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php
index 66d6bda..dc7cbe5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationSuccessHandler.php
@@ -102,7 +102,7 @@ class DefaultAuthenticationSuccessHandler implements AuthenticationSuccessHandle
return $targetUrl;
}
- if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $request->getUriForPath($this->options['login_path'])) {
+ if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $this->httpUtils->generateUri($request, $this->options['login_path'])) {
return $targetUrl;
}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/InteractiveLoginEvent.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/InteractiveLoginEvent.php
index f242501..2225d92 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/InteractiveLoginEvent.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Http/Event/InteractiveLoginEvent.php
@@ -21,17 +21,33 @@ class InteractiveLoginEvent extends Event
private $authenticationToken;
+ /**
+ * Constructor.
+ *
+ * @param Request $request A Request instance
+ * @param TokenInterface $authenticationToken A TokenInterface instance
+ */
public function __construct(Request $request, TokenInterface $authenticationToken)
{
$this->request = $request;
$this->authenticationToken = $authenticationToken;
}
+ /**
+ * Gets the request.
+ *
+ * @return Request A Request instance
+ */
public function getRequest()
{
return $this->request;
}
+ /**
+ * Gets the authentication token.
+ *
+ * @return TokenInterface A TokenInterface instance
+ */
public function getAuthenticationToken()
{
return $this->authenticationToken;
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php
index e264b6d..837daad 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php
@@ -267,7 +267,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase
$provider->updateAcl($acl);
}
- public function testUpdateAclThrowsExceptionOnConcurrentModifcationOfSharedProperties()
+ public function testUpdateAclThrowsExceptionOnConcurrentModificationOfSharedProperties()
{
$provider = $this->getProvider();
$acl1 = $provider->createAcl(new ObjectIdentity(1, 'Foo'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php
index b6f3d79..4b67e62 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php
@@ -433,7 +433,7 @@ class AclTest extends \PHPUnit_Framework_TestCase
* @expectedException \InvalidArgumentException
* @dataProvider getUpdateFieldAuditingTests
*/
- public function testUpdateFieldAuditingthrowsExceptionOnInvalidField($type)
+ public function testUpdateFieldAuditingThrowsExceptionOnInvalidField($type)
{
$acl = $this->getAcl();
$acl->{'update'.$type.'Auditing'}(0, 'foo', true, true);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
index 67c9f3f..f34bc3e 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php
@@ -31,7 +31,7 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($strategy->isGranted($acl, array(1), array($sid)));
}
- public function testIsGrantedFallsbackToClassAcesIfNoApplicableObjectAceWasFound()
+ public function testIsGrantedFallsBackToClassAcesIfNoApplicableObjectAceWasFound()
{
$strategy = new PermissionGrantingStrategy();
$acl = $this->getAcl($strategy);
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/UserSecurityIdentityTest.php b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/UserSecurityIdentityTest.php
index 9650803..1d6a3c5 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/UserSecurityIdentityTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Security/Tests/Acl/Domain/UserSecurityIdentityTest.php
@@ -25,7 +25,7 @@ class UserSecurityIdentityTest extends \PHPUnit_Framework_TestCase
}
// Test that constructor never changes the type, even for proxies
- public function testContructorWithProxy()
+ public function testConstructorWithProxy()
{
$id = new UserSecurityIdentity('foo', 'Acme\DemoBundle\Proxy\__CG__\Symfony\Component\Security\Tests\Acl\Domain\Foo');
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/SerializerAwareNormalizer.php b/vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/SerializerAwareNormalizer.php
index 97e5dfb..49916be 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/SerializerAwareNormalizer.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Serializer/Normalizer/SerializerAwareNormalizer.php
@@ -21,6 +21,9 @@ use Symfony\Component\Serializer\SerializerAwareInterface;
*/
abstract class SerializerAwareNormalizer implements SerializerAwareInterface
{
+ /**
+ * @var SerializerInterface
+ */
protected $serializer;
/**
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
index f3f1fb8..29177ff 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php
@@ -24,7 +24,7 @@ foo', 'foo;foo' => 'bar'));
$tempDir = sys_get_temp_dir();
$dumper = new CsvFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/valid.csv'), file_get_contents($tempDir.'/messages.en.csv'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
index ce1da5a..d187ef1 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
@@ -27,7 +27,7 @@ class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new IcuResFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir.'/messages/en.res'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php
index be5895a..2a2cefd 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php
@@ -23,7 +23,7 @@ class IniFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new IniFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ini'), file_get_contents($tempDir.'/messages.en.ini'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php
index 5b35d81..439a25c 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php
@@ -23,7 +23,7 @@ class MoFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new MoFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.mo'), file_get_contents($tempDir.'/messages.en.mo'));
unlink($tempDir.'/messages.en.mo');
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php
index ef37d18..18be5a0 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php
@@ -23,7 +23,7 @@ class PhpFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new PhpFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.php'), file_get_contents($tempDir.'/messages.en.php'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php
index 9c434f9..0296d6b 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php
@@ -23,7 +23,7 @@ class PoFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new PoFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.po'), file_get_contents($tempDir.'/messages.en.po'));
unlink($tempDir.'/messages.en.po');
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php
index 8e63ee9..d7d8fb7 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php
@@ -23,7 +23,7 @@ class QtFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new QtFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ts'), file_get_contents($tempDir.'/resources.en.ts'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
index 5514221..bef3135 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php
@@ -23,7 +23,7 @@ class XliffFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new XliffFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources-clean.xlf'), file_get_contents($tempDir.'/messages.en.xlf'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php
index e96681c..e4e68e0 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php
@@ -30,7 +30,7 @@ class YamlFileDumperTest extends \PHPUnit_Framework_TestCase
$tempDir = sys_get_temp_dir();
$dumper = new YamlFileDumper();
- $dumperString = $dumper->dump($catalogue, array('path' => $tempDir));
+ $dumper->dump($catalogue, array('path' => $tempDir));
$this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.yml'), file_get_contents($tempDir.'/messages.en.yml'));
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php
index 4832ab7..26f9e2f 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php
@@ -22,7 +22,7 @@ use Symfony\Component\Translation\PluralizationRules;
*
* As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199
*
- * The goal to cover all languagues is to far fetched so this test case is smaller.
+ * The goal to cover all languages is to far fetched so this test case is smaller.
*
* @author Clemens Tolboom clemens@build2be.nl
*/
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Translation/Writer/TranslationWriter.php b/vendor/symfony/symfony/src/Symfony/Component/Translation/Writer/TranslationWriter.php
index 4d68ce5..6e935e0 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Translation/Writer/TranslationWriter.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Translation/Writer/TranslationWriter.php
@@ -53,7 +53,7 @@ class TranslationWriter
* Writes translation from the catalogue according to the selected format.
*
* @param MessageCatalogue $catalogue The message catalogue to dump
- * @param type $format The format to use to dump the messages
+ * @param string $format The format to use to dump the messages
* @param array $options Options that are passed to the dumper
*/
public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array())
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/CHANGELOG.md b/vendor/symfony/symfony/src/Symfony/Component/Validator/CHANGELOG.md
index dbc3e0b..e49881a 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/CHANGELOG.md
+++ b/vendor/symfony/symfony/src/Symfony/Component/Validator/CHANGELOG.md
@@ -23,6 +23,6 @@ CHANGELOG
which enables the BC behavior.
* added Count constraint
* added Length constraint
- * deprecated the Size constraint and renamed it to Range
+ * added Range constraint
* deprecated the Min and Max constraints
* deprecated the MinLength and MaxLength constraints
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Size.php b/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Size.php
deleted file mode 100644
index 625f86e..0000000
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/Size.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * 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;
-
-/**
- * @Annotation
- *
- * @api
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
-class Size extends Range
-{
- /**
- * {@inheritDoc}
- */
- public function validatedBy()
- {
- return get_parent_class($this).'Validator';
- }
-}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/SizeValidator.php b/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/SizeValidator.php
deleted file mode 100644
index 605e74b..0000000
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/Constraints/SizeValidator.php
+++ /dev/null
@@ -1,26 +0,0 @@
-
- *
- * 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;
-use Symfony\Component\Validator\ConstraintValidator;
-
-/**
- * @author Bernhard Schussek
- *
- * @api
- *
- * @deprecated Deprecated since version 2.1, to be removed in 2.3.
- */
-class SizeValidator extends RangeValidator
-{
-}
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php
index dbcef69..5a343b4 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php
@@ -108,7 +108,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testValidValuesMin($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$this->context->expects($this->never())
@@ -124,7 +124,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testValidValuesMax($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$this->context->expects($this->never())
@@ -140,7 +140,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testValidValuesExact($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$this->context->expects($this->never())
@@ -156,7 +156,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testInvalidValuesMin($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$constraint = new Length(array(
@@ -180,7 +180,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testInvalidValuesMax($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$constraint = new Length(array(
@@ -204,7 +204,7 @@ class LengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testInvalidValuesExact($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$constraint = new Length(array(
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php
index 12091b7..4db9103 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MaxLengthValidatorTest.php
@@ -62,7 +62,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testValidValues($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$this->context->expects($this->never())
@@ -88,7 +88,7 @@ class MaxLengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testInvalidValues($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$constraint = new MaxLength(array(
diff --git a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php
index e3a1d01..08d0a81 100644
--- a/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php
+++ b/vendor/symfony/symfony/src/Symfony/Component/Validator/Tests/Constraints/MinLengthValidatorTest.php
@@ -62,7 +62,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testValidValues($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$this->context->expects($this->never())
@@ -88,7 +88,7 @@ class MinLengthValidatorTest extends \PHPUnit_Framework_TestCase
public function testInvalidValues($value, $mbOnly = false)
{
if ($mbOnly && !function_exists('mb_strlen')) {
- return $this->markTestSkipped('mb_strlen does not exist');
+ $this->markTestSkipped('mb_strlen does not exist');
}
$constraint = new MinLength(array(
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test
index 357b352..2bd3d4c 100644
--- a/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test
+++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/filters/merge.test
@@ -5,10 +5,12 @@
{{ items|merge({'bar': 'foo'})|keys|join }}
{{ {'bar': 'foo'}|merge(items)|join }}
{{ {'bar': 'foo'}|merge(items)|keys|join }}
+{{ numerics|merge([4, 5, 6])|join }}
--DATA--
-return array('items' => array('foo' => 'bar'))
+return array('items' => array('foo' => 'bar'), 'numerics' => array(1, 2, 3))
--EXPECT--
barfoo
foobar
foobar
barfoo
+123456
| |