Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6e0d085

Browse filesBrowse files
committed
Merge branch '3.0'
* 3.0: [DependencyInjection] fix dumped YAML snytax Remove InputOption::VALUE_REQUIRED mode from $default parameter description as InputOption::setDefault() throws an exception only when called in InputOption::VALUE_NONE mode. In practice the $default value could still be accessed in InputOption::VALUE_REQUIRED mode in case InputOption was never set but accessed from InputDefinition::getOption() method [Yaml] always restore the error handler in tests [FrameworkBundle] fix YAML syntax fix YAML syntax in functional tests config [HttpFoundation] [Session] Removed unnecessary PHP version check as minimum requirement is now 5.5.9 [Form] Fixed violation mapping if multiple forms are using the same (or part of the same) property path fix FQCN in tests added by #17694 Fix locale and written standard inconsistencies for Norwegian translations [Form] [Validator] Fix locale inconsistencies in Norwegian translations [TwigBridge] Symfony 3.1 forward compatibility fixed CS [DependencyInjection] fixed exceptions thrown by get method of ContainerBuilder [Yaml] properly parse lists in object maps [FrameworkBundle] Remove unused private method. [Form] remove useless code in ResizeFormListener [Config] Fix EnumNodeDefinition to allow building enum nodes with one element [Form] remove deprecated empty_value_in_choices fix choice_value option in EntityType and add some tests
2 parents 74ffd6b + f0dffcb commit 6e0d085
Copy full SHA for 6e0d085

File tree

Expand file treeCollapse file tree

28 files changed

+488
-414
lines changed
Filter options
Expand file treeCollapse file tree

28 files changed

+488
-414
lines changed

‎src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Form/ChoiceList/DoctrineChoiceLoader.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function loadChoicesForValues(array $values, $value = null)
146146

147147
// Optimize performance in case we have an object loader and
148148
// a single-field identifier
149-
if (!$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) {
149+
if (null === $value && !$this->choiceList && $this->objectLoader && $this->idReader->isSingleId()) {
150150
$unorderedObjects = $this->objectLoader->getEntitiesByIds($this->idReader->getIdField(), $values);
151151
$objectsById = array();
152152
$objects = array();

‎src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php
+49Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,55 @@ public function testOverrideChoices()
753753
$this->assertSame('2', $field->getViewData());
754754
}
755755

756+
public function testOverrideChoicesValues()
757+
{
758+
$entity1 = new SingleIntIdEntity(1, 'Foo');
759+
$entity2 = new SingleIntIdEntity(2, 'Bar');
760+
761+
$this->persist(array($entity1, $entity2));
762+
763+
$field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
764+
'em' => 'default',
765+
'class' => self::SINGLE_IDENT_CLASS,
766+
'choice_label' => 'name',
767+
'choice_value' => 'name',
768+
));
769+
770+
$field->submit('Bar');
771+
772+
$this->assertEquals(array('Foo' => new ChoiceView($entity1, 'Foo', 'Foo'), 'Bar' => new ChoiceView($entity2, 'Bar', 'Bar')), $field->createView()->vars['choices']);
773+
$this->assertTrue($field->isSynchronized(), 'Field should be synchronized.');
774+
$this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.');
775+
$this->assertSame('Bar', $field->getViewData());
776+
}
777+
778+
public function testOverrideChoicesValuesWithCallable()
779+
{
780+
$entity1 = new GroupableEntity(1, 'Foo', 'BazGroup');
781+
$entity2 = new GroupableEntity(2, 'Bar', 'BooGroup');
782+
783+
$this->persist(array($entity1, $entity2));
784+
785+
$field = $this->factory->createNamed('name', 'Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
786+
'em' => 'default',
787+
'class' => self::ITEM_GROUP_CLASS,
788+
'choice_label' => 'name',
789+
'choice_value' => function (GroupableEntity $entity) {
790+
return $entity->groupName.'/'.$entity->name;
791+
},
792+
));
793+
794+
$field->submit('BooGroup/Bar');
795+
796+
$this->assertEquals(array(
797+
'BazGroup/Foo' => new ChoiceView($entity1, 'BazGroup/Foo', 'Foo'),
798+
'BooGroup/Bar' => new ChoiceView($entity2, 'BooGroup/Bar', 'Bar'),
799+
), $field->createView()->vars['choices']);
800+
$this->assertTrue($field->isSynchronized(), 'Field should be synchronized.');
801+
$this->assertSame($entity2, $field->getData(), 'Entity should be loaded by custom value.');
802+
$this->assertSame('BooGroup/Bar', $field->getViewData());
803+
}
804+
756805
public function testGroupByChoices()
757806
{
758807
$item1 = new GroupableEntity(1, 'Foo', 'Group1');

‎src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
-11Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,6 @@ private function formatRouterConfig(array $config)
411411
return trim($configAsString);
412412
}
413413

414-
/**
415-
* @param string $section
416-
* @param string $message
417-
*
418-
* @return string
419-
*/
420-
private function formatSection($section, $message)
421-
{
422-
return sprintf('<info>[%s]</info> %s', $section, $message);
423-
}
424-
425414
/**
426415
* @param callable $callable
427416
*

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/assets.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
framework:
22
assets:
33
version: SomeVersionScheme
4-
version_format: %%s?version=%%s
4+
version_format: '%%s?version=%%s'
55
base_urls: http://cdn.example.com
66
packages:
77
images_path:
@@ -11,7 +11,7 @@ framework:
1111
base_urls: ["http://images1.example.com", "http://images2.example.com"]
1212
foo:
1313
version: 1.0.0
14-
version_format: %%s-%%s
14+
version_format: '%%s-%%s'
1515
bar:
1616
base_urls: ["https://bar2.example.com"]
1717
bar_version_strategy:

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/full.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ framework:
1313
only_exceptions: true
1414
enabled: false
1515
router:
16-
resource: %kernel.root_dir%/config/routing.xml
16+
resource: '%kernel.root_dir%/config/routing.xml'
1717
type: xml
1818
session:
1919
storage_id: session.storage.native
@@ -48,7 +48,7 @@ framework:
4848
annotations:
4949
cache: file
5050
debug: true
51-
file_cache_dir: %kernel.cache_dir%/annotations
51+
file_cache_dir: '%kernel.cache_dir%/annotations'
5252
serializer:
5353
enabled: true
5454
enable_annotations: true

‎src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/twig.yml

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/config/twig.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ framework:
33

44
# Twig Configuration
55
twig:
6-
debug: %kernel.debug%
7-
strict_variables: %kernel.debug%
6+
debug: '%kernel.debug%'
7+
strict_variables: '%kernel.debug%'

‎src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Definition/Builder/EnumNodeDefinition.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public function values(array $values)
3131
{
3232
$values = array_unique($values);
3333

34-
if (count($values) <= 1) {
35-
throw new \InvalidArgumentException('->values() must be called with at least two distinct values.');
34+
if (empty($values)) {
35+
throw new \InvalidArgumentException('->values() must be called with at least one value.');
3636
}
3737

3838
$this->values = $values;

‎src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Definition/Builder/EnumNodeDefinitionTest.php
+23-5Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,22 @@
1515

1616
class EnumNodeDefinitionTest extends \PHPUnit_Framework_TestCase
1717
{
18-
/**
19-
* @expectedException \InvalidArgumentException
20-
* @expectedExceptionMessage ->values() must be called with at least two distinct values.
21-
*/
22-
public function testNoDistinctValues()
18+
public function testWithOneValue()
19+
{
20+
$def = new EnumNodeDefinition('foo');
21+
$def->values(array('foo'));
22+
23+
$node = $def->getNode();
24+
$this->assertEquals(array('foo'), $node->getValues());
25+
}
26+
27+
public function testWithOneDistinctValue()
2328
{
2429
$def = new EnumNodeDefinition('foo');
2530
$def->values(array('foo', 'foo'));
31+
32+
$node = $def->getNode();
33+
$this->assertEquals(array('foo'), $node->getValues());
2634
}
2735

2836
/**
@@ -35,6 +43,16 @@ public function testNoValuesPassed()
3543
$def->getNode();
3644
}
3745

46+
/**
47+
* @expectedException \InvalidArgumentException
48+
* @expectedExceptionMessage ->values() must be called with at least one value.
49+
*/
50+
public function testWithNoValues()
51+
{
52+
$def = new EnumNodeDefinition('foo');
53+
$def->values(array());
54+
}
55+
3856
public function testGetNode()
3957
{
4058
$def = new EnumNodeDefinition('foo');

‎src/Symfony/Component/Console/Command/Command.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public function addArgument($name, $mode = null, $description = '', $default = n
383383
* @param string $shortcut The shortcut (can be null)
384384
* @param int $mode The option mode: One of the InputOption::VALUE_* constants
385385
* @param string $description A description text
386-
* @param mixed $default The default value (must be null for InputOption::VALUE_REQUIRED or InputOption::VALUE_NONE)
386+
* @param mixed $default The default value (must be null for InputOption::VALUE_NONE)
387387
*
388388
* @return Command The current instance
389389
*/

‎src/Symfony/Component/Console/Input/InputOption.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Input/InputOption.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class InputOption
3939
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
4040
* @param int $mode The option mode: One of the VALUE_* constants
4141
* @param string $description A description text
42-
* @param mixed $default The default value (must be null for self::VALUE_REQUIRED or self::VALUE_NONE)
42+
* @param mixed $default The default value (must be null for self::VALUE_NONE)
4343
*
4444
* @throws InvalidArgumentException If option mode is invalid or incompatible
4545
*/

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
1919
use Symfony\Component\DependencyInjection\Exception\LogicException;
2020
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
21+
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
22+
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
2123
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
2224
use Symfony\Component\Config\Resource\FileResource;
2325
use Symfony\Component\Config\Resource\ResourceInterface;
@@ -398,8 +400,9 @@ public function has($id)
398400
*
399401
* @return object The associated service
400402
*
401-
* @throws InvalidArgumentException when no definitions are available
402-
* @throws LogicException when a circular dependency is detected
403+
* @throws InvalidArgumentException when no definitions are available
404+
* @throws ServiceCircularReferenceException When a circular reference is detected
405+
* @throws ServiceNotFoundException When the service is not defined
403406
* @throws \Exception
404407
*
405408
* @see Reference
@@ -418,7 +421,7 @@ public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INV
418421

419422
try {
420423
$definition = $this->getDefinition($id);
421-
} catch (InvalidArgumentException $e) {
424+
} catch (ServiceNotFoundException $e) {
422425
if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
423426
return;
424427
}
@@ -758,14 +761,14 @@ public function hasDefinition($id)
758761
*
759762
* @return Definition A Definition instance
760763
*
761-
* @throws InvalidArgumentException if the service definition does not exist
764+
* @throws ServiceNotFoundException if the service definition does not exist
762765
*/
763766
public function getDefinition($id)
764767
{
765768
$id = strtolower($id);
766769

767770
if (!array_key_exists($id, $this->definitions)) {
768-
throw new InvalidArgumentException(sprintf('The service definition "%s" does not exist.', $id));
771+
throw new ServiceNotFoundException($id);
769772
}
770773

771774
return $this->definitions[$id];
@@ -780,7 +783,7 @@ public function getDefinition($id)
780783
*
781784
* @return Definition A Definition instance
782785
*
783-
* @throws InvalidArgumentException if the service definition does not exist
786+
* @throws ServiceNotFoundException if the service definition does not exist
784787
*/
785788
public function findDefinition($id)
786789
{

‎src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private function addService($id, $definition)
6565
$class = substr($class, 1);
6666
}
6767

68-
$code .= sprintf(" class: %s\n", $class);
68+
$code .= sprintf(" class: %s\n", $this->dumper->dump($class));
6969
}
7070

7171
if (!$definition->isPublic()) {

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
use Symfony\Component\DependencyInjection\ContainerInterface;
2121
use Symfony\Component\DependencyInjection\Definition;
2222
use Symfony\Component\DependencyInjection\Exception\RuntimeException;
23+
use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
24+
use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
25+
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
2326
use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
2427
use Symfony\Component\DependencyInjection\Reference;
2528
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
@@ -49,9 +52,9 @@ public function testDefinitions()
4952

5053
try {
5154
$builder->getDefinition('baz');
52-
$this->fail('->getDefinition() throws an InvalidArgumentException if the service definition does not exist');
53-
} catch (\InvalidArgumentException $e) {
54-
$this->assertEquals('The service definition "baz" does not exist.', $e->getMessage(), '->getDefinition() throws an InvalidArgumentException if the service definition does not exist');
55+
$this->fail('->getDefinition() throws a ServiceNotFoundException if the service definition does not exist');
56+
} catch (ServiceNotFoundException $e) {
57+
$this->assertEquals('You have requested a non-existent service "baz".', $e->getMessage(), '->getDefinition() throws a ServiceNotFoundException if the service definition does not exist');
5558
}
5659
}
5760

@@ -101,9 +104,9 @@ public function testGet()
101104
$builder = new ContainerBuilder();
102105
try {
103106
$builder->get('foo');
104-
$this->fail('->get() throws an InvalidArgumentException if the service does not exist');
105-
} catch (\InvalidArgumentException $e) {
106-
$this->assertEquals('The service definition "foo" does not exist.', $e->getMessage(), '->get() throws an InvalidArgumentException if the service does not exist');
107+
$this->fail('->get() throws a ServiceNotFoundException if the service does not exist');
108+
} catch (ServiceNotFoundException $e) {
109+
$this->assertEquals('You have requested a non-existent service "foo".', $e->getMessage(), '->get() throws a ServiceNotFoundException if the service does not exist');
107110
}
108111

109112
$this->assertNull($builder->get('foo', ContainerInterface::NULL_ON_INVALID_REFERENCE), '->get() returns null if the service does not exist and NULL_ON_INVALID_REFERENCE is passed as a second argument');

‎src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php
+9-6Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\DependencyInjection\ContainerBuilder;
1515
use Symfony\Component\DependencyInjection\Dumper\YamlDumper;
16+
use Symfony\Component\Yaml\Yaml;
1617

1718
class YamlDumperTest extends \PHPUnit_Framework_TestCase
1819
{
@@ -27,24 +28,21 @@ public function testDump()
2728
{
2829
$dumper = new YamlDumper($container = new ContainerBuilder());
2930

30-
$this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services1.yml', $dumper->dump(), '->dump() dumps an empty container as an empty YAML file');
31-
32-
$container = new ContainerBuilder();
33-
$dumper = new YamlDumper($container);
31+
$this->assertEqualYamlStructure(self::$fixturesPath.'/yaml/services1.yml', $dumper->dump(), '->dump() dumps an empty container as an empty YAML file');
3432
}
3533

3634
public function testAddParameters()
3735
{
3836
$container = include self::$fixturesPath.'/containers/container8.php';
3937
$dumper = new YamlDumper($container);
40-
$this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services8.yml', $dumper->dump(), '->dump() dumps parameters');
38+
$this->assertEqualYamlStructure(self::$fixturesPath.'/yaml/services8.yml', $dumper->dump(), '->dump() dumps parameters');
4139
}
4240

4341
public function testAddService()
4442
{
4543
$container = include self::$fixturesPath.'/containers/container9.php';
4644
$dumper = new YamlDumper($container);
47-
$this->assertEquals(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services');
45+
$this->assertEqualYamlStructure(str_replace('%path%', self::$fixturesPath.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR, file_get_contents(self::$fixturesPath.'/yaml/services9.yml')), $dumper->dump(), '->dump() dumps services');
4846

4947
$dumper = new YamlDumper($container = new ContainerBuilder());
5048
$container->register('foo', 'FooClass')->addArgument(new \stdClass());
@@ -63,4 +61,9 @@ public function testDumpAutowireData()
6361
$dumper = new YamlDumper($container);
6462
$this->assertStringEqualsFile(self::$fixturesPath.'/yaml/services24.yml', $dumper->dump());
6563
}
64+
65+
private function assertEqualYamlStructure($yaml, $expected, $message = '')
66+
{
67+
$this->assertEquals(Yaml::parse($expected), Yaml::parse($yaml), $message);
68+
}
6669
}

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services10.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ services:
66
class: BAR
77

88
project:
9-
test: %project.parameter.foo%
9+
test: '%project.parameter.foo%'

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services6.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
foo: { class: FooClass }
33
baz: { class: BazClass }
44
not_shared: { class: FooClass, shared: false }
5-
file: { class: FooClass, file: %path%/foo.php }
5+
file: { class: FooClass, file: '%path%/foo.php' }
66
arguments: { class: FooClass, arguments: [foo, '@foo', [true, false]] }
77
configurator1: { class: FooClass, configurator: sc_configure }
88
configurator2: { class: FooClass, configurator: ['@baz', configure] }

‎src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services9.yml
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ services:
1818
factory: [Bar\FooClass, getInstance]
1919
configurator: sc_configure
2020
foo.baz:
21-
class: %baz_class%
21+
class: '%baz_class%'
2222
factory: ['%baz_class%', getInstance]
2323
configurator: ['%baz_class%', configureStatic1]
2424
bar:
2525
class: Bar\FooClass
2626
arguments: [foo, '@foo.baz', '%foo_bar%']
2727
configurator: ['@foo.baz', configure]
2828
foo_bar:
29-
class: %foo_class%
29+
class: '%foo_class%'
3030
shared: false
3131
method_call1:
3232
class: Bar\FooClass
33-
file: %path%foo.php
33+
file: '%path%foo.php'
3434
calls:
3535
- [setBar, ['@foo']]
3636
- [setBar, ['@?foo2']]

‎src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ public function preSubmit(FormEvent $event)
102102
$form = $event->getForm();
103103
$data = $event->getData();
104104

105-
if (null === $data || '' === $data) {
106-
$data = array();
107-
}
108-
109105
if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
110106
$data = array();
111107
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.