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 d3f3721

Browse filesBrowse files
Merge branch '3.4'
* 3.4: (33 commits) Remove remaining `@experimental` annotations Tests and fix for issue in array model data in EntityType field with multiple=true [Validator] Add unique entity violation cause [Lock] Automaticaly release lock when user forget it [Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible fixed CS [FrameworkBundle] Don't clear app pools on cache:clear Hide label button when its setted to false removed useless PHPDoc [HttpFoundation] Return instance in StreamedResponse [Form] Fix FormInterface::submit() annotation [PHPUnitBridge] don't remove when set to empty string PdoSessionHandler: fix advisory lock for pgsql when session.sid_bits_per_character > 4 HttpCache does not consider ESI resources in HEAD requests Fix translation for "This field was not expected" [Routing] Enhance Route(Collection) docblocks Added improvement for accuracy in MoneyToLocalizedStringTransformer. Removed unused private property Use correct verb form in the pull request template Use PHP_MAXPATHLEN in Filesystem. ...
2 parents cebedd7 + fedcc91 commit d3f3721
Copy full SHA for d3f3721

File tree

359 files changed

+2531
-1058
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

359 files changed

+2531
-1058
lines changed

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
| ------------- | ---
33
| Branch? | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
44
| Bug fix? | yes/no
5-
| New feature? | yes/no <!-- don't forget updating src/**/CHANGELOG.md files -->
5+
| New feature? | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
66
| BC breaks? | yes/no
7-
| Deprecations? | yes/no <!-- don't forget updating UPGRADE-*.md files -->
7+
| Deprecations? | yes/no <!-- don't forget to update UPGRADE-*.md files -->
88
| Tests pass? | yes/no
99
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
1010
| License | MIT

‎UPGRADE-3.4.md

Copy file name to clipboardExpand all lines: UPGRADE-3.4.md
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Form
113113
FrameworkBundle
114114
---------------
115115

116+
* The `cache:clear` command doesn't clear "app" PSR-6 cache pools anymore,
117+
but still clears "system" ones.
118+
Use the `cache:pool:clear` command to clear "app" pools instead.
119+
116120
* The `doctrine/cache` dependency has been removed; require it via `composer
117121
require doctrine/cache` if you are using Doctrine cache in your project.
118122

‎src/Symfony/Bridge/Doctrine/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ CHANGELOG
1515
-----
1616

1717
* added support for doctrine/dbal v2.6 types
18+
* added cause of UniqueEntity constraint violation
1819

1920
3.1.0
2021
-----

‎src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/CacheWarmer/ProxyCacheWarmer.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class ProxyCacheWarmer implements CacheWarmerInterface
2727
private $registry;
2828

2929
/**
30-
* Constructor.
31-
*
3230
* @param ManagerRegistry $registry A ManagerRegistry instance
3331
*/
3432
public function __construct(ManagerRegistry $registry)

‎src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DataFixtures/ContainerAwareLoader.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class ContainerAwareLoader extends Loader
3131
private $container;
3232

3333
/**
34-
* Constructor.
35-
*
3634
* @param ContainerInterface $container A ContainerInterface instance
3735
*/
3836
public function __construct(ContainerInterface $container)

‎src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class RegisterEventListenersAndSubscribersPass implements CompilerPassInterface
3232
private $tagPrefix;
3333

3434
/**
35-
* Constructor.
36-
*
3735
* @param string $connections Parameter ID for connections
3836
* @param string $managerTemplate sprintf() template for generating the event
3937
* manager's service ID for a connection name

‎src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
9797
private $aliasMap;
9898

9999
/**
100-
* Constructor.
101-
*
102100
* The $managerParameters is an ordered list of container parameters that could provide the
103101
* name of the manager to register these namespaces and alias on. The first non-empty name
104102
* is used, the others skipped.

‎src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class DbalSessionHandler implements \SessionHandlerInterface
5454
private $timeCol = 'sess_time';
5555

5656
/**
57-
* Constructor.
58-
*
5957
* @param Connection $con A connection
6058
* @param string $tableName Table name
6159
*/

‎src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Logger/DbalLogger.php
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
use Doctrine\DBAL\Logging\SQLLogger;
1717

1818
/**
19-
* DbalLogger.
20-
*
2119
* @author Fabien Potencier <fabien@symfony.com>
2220
*/
2321
class DbalLogger implements SQLLogger
@@ -29,8 +27,6 @@ class DbalLogger implements SQLLogger
2927
protected $stopwatch;
3028

3129
/**
32-
* Constructor.
33-
*
3430
* @param LoggerInterface $logger A LoggerInterface instance
3531
* @param Stopwatch $stopwatch A Stopwatch instance
3632
*/

‎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
+34Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,4 +1455,38 @@ public function testSubmitNullExpandedMultiple()
14551455
$this->assertEquals($collection, $form->getNormData());
14561456
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
14571457
}
1458+
1459+
public function testSetDataEmptyArraySubmitNullMultiple()
1460+
{
1461+
$emptyArray = array();
1462+
$form = $this->factory->create(static::TESTED_TYPE, null, array(
1463+
'em' => 'default',
1464+
'class' => self::SINGLE_IDENT_CLASS,
1465+
'multiple' => true,
1466+
));
1467+
$form->setData($emptyArray);
1468+
$form->submit(null);
1469+
$this->assertInternalType('array', $form->getData());
1470+
$this->assertEquals(array(), $form->getData());
1471+
$this->assertEquals(array(), $form->getNormData());
1472+
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
1473+
}
1474+
1475+
public function testSetDataNonEmptyArraySubmitNullMultiple()
1476+
{
1477+
$entity1 = new SingleIntIdEntity(1, 'Foo');
1478+
$this->persist(array($entity1));
1479+
$form = $this->factory->create(static::TESTED_TYPE, null, array(
1480+
'em' => 'default',
1481+
'class' => self::SINGLE_IDENT_CLASS,
1482+
'multiple' => true,
1483+
));
1484+
$existing = array(0 => $entity1);
1485+
$form->setData($existing);
1486+
$form->submit(null);
1487+
$this->assertInternalType('array', $form->getData());
1488+
$this->assertEquals(array(), $form->getData());
1489+
$this->assertEquals(array(), $form->getNormData());
1490+
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
1491+
}
14581492
}

‎src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php
+46Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ public function testValidateUniqueness()
190190
->atPath('property.path.name')
191191
->setParameter('{{ value }}', '"Foo"')
192192
->setInvalidValue($entity2)
193+
->setCause(array($entity1))
193194
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
194195
->assertRaised();
195196
}
@@ -215,6 +216,7 @@ public function testValidateCustomErrorPath()
215216
->atPath('property.path.bar')
216217
->setParameter('{{ value }}', '"Foo"')
217218
->setInvalidValue($entity2)
219+
->setCause(array($entity1))
218220
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
219221
->assertRaised();
220222
}
@@ -268,6 +270,7 @@ public function testValidateUniquenessWithIgnoreNullDisabled()
268270
->atPath('property.path.name')
269271
->setParameter('{{ value }}', '"Foo"')
270272
->setInvalidValue('Foo')
273+
->setCause(array($entity1))
271274
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
272275
->assertRaised();
273276
}
@@ -346,6 +349,7 @@ public function testValidateUniquenessWithValidCustomErrorPath()
346349
->atPath('property.path.name2')
347350
->setParameter('{{ value }}', '"Bar"')
348351
->setInvalidValue('Bar')
352+
->setCause(array($entity1))
349353
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
350354
->assertRaised();
351355
}
@@ -481,6 +485,7 @@ public function testAssociatedEntity()
481485
->setParameter('{{ value }}', 'object("Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity") identified by (id => 1)')
482486
->setInvalidValue($entity1)
483487
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
488+
->setCause(array($associated, $associated2))
484489
->assertRaised();
485490
}
486491

@@ -517,6 +522,7 @@ public function testValidateUniquenessNotToStringEntityWithAssociatedEntity()
517522
->atPath('property.path.single')
518523
->setParameter('{{ value }}', $expectedValue)
519524
->setInvalidValue($entity1)
525+
->setCause(array($associated, $associated2))
520526
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
521527
->assertRaised();
522528
}
@@ -575,6 +581,7 @@ public function testValidateUniquenessWithArrayValue()
575581
->atPath('property.path.phoneNumbers')
576582
->setParameter('{{ value }}', 'array')
577583
->setInvalidValue(array(123))
584+
->setCause(array($entity1))
578585
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
579586
->assertRaised();
580587
}
@@ -652,6 +659,7 @@ public function testValidateInheritanceUniqueness()
652659
->atPath('property.path.name')
653660
->setInvalidValue('Foo')
654661
->setCode('23bd9dbf-6b9b-41cd-a99e-4844bcf3077f')
662+
->setCause(array($entity1))
655663
->setParameters(array('{{ value }}' => '"Foo"'))
656664
->assertRaised();
657665
}
@@ -703,6 +711,7 @@ public function testValidateUniquenessWithCompositeObjectNoToStringIdEntity()
703711
->atPath('property.path.objectOne')
704712
->setParameter('{{ value }}', $expectedValue)
705713
->setInvalidValue($objectOne)
714+
->setCause(array($entity))
706715
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
707716
->assertRaised();
708717
}
@@ -730,6 +739,43 @@ public function testValidateUniquenessWithCustomDoctrineTypeValue()
730739
->atPath('property.path.name')
731740
->setParameter('{{ value }}', $expectedValue)
732741
->setInvalidValue($existingEntity->name)
742+
->setCause(array($existingEntity))
743+
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
744+
->assertRaised();
745+
}
746+
747+
/**
748+
* This is a functional test as there is a large integration necessary to get the validator working.
749+
*/
750+
public function testValidateUniquenessCause()
751+
{
752+
$constraint = new UniqueEntity(array(
753+
'message' => 'myMessage',
754+
'fields' => array('name'),
755+
'em' => self::EM_NAME,
756+
));
757+
758+
$entity1 = new SingleIntIdEntity(1, 'Foo');
759+
$entity2 = new SingleIntIdEntity(2, 'Foo');
760+
761+
$this->validator->validate($entity1, $constraint);
762+
763+
$this->assertNoViolation();
764+
765+
$this->em->persist($entity1);
766+
$this->em->flush();
767+
768+
$this->validator->validate($entity1, $constraint);
769+
770+
$this->assertNoViolation();
771+
772+
$this->validator->validate($entity2, $constraint);
773+
774+
$this->buildViolation('myMessage')
775+
->atPath('property.path.name')
776+
->setParameter('{{ value }}', '"Foo"')
777+
->setInvalidValue($entity2)
778+
->setCause(array($entity1))
733779
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
734780
->assertRaised();
735781
}

‎src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function validate($entity, Constraint $constraint)
171171
->setParameter('{{ value }}', $this->formatWithIdentifiers($em, $class, $invalidValue))
172172
->setInvalidValue($invalidValue)
173173
->setCode(UniqueEntity::NOT_UNIQUE_ERROR)
174+
->setCause($result)
174175
->addViolation();
175176
}
176177

‎src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Formatter/ConsoleFormatter.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ class ConsoleFormatter implements FormatterInterface
4747
private $dumper;
4848

4949
/**
50-
* Constructor.
51-
*
5250
* Available options:
5351
* * format: The format of the outputted log string. The following placeholders are supported: %datetime%, %start_tag%, %level_name%, %end_tag%, %channel%, %message%, %context%, %extra%;
5452
* * date_format: The format of the outputted date string;

‎src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Monolog/Handler/ConsoleHandler.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
5757
);
5858

5959
/**
60-
* Constructor.
61-
*
6260
* @param OutputInterface|null $output The console output to use (the handler remains disabled when passing null
6361
* until the output is set, e.g. by using console events)
6462
* @param bool $bubble Whether the messages that are handled can bubble up the stack

‎src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/PhpUnit/bin/simple-phpunit
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
6060
$zip->extractTo(getcwd());
6161
$zip->close();
6262
chdir("phpunit-$PHPUNIT_VERSION");
63-
passthru("$COMPOSER remove --no-update ".(getenv('SYMFONY_PHPUNIT_REMOVE') ?: 'phpspec/prophecy symfony/yaml'));
63+
$SYMFONY_PHPUNIT_REMOVE = getenv('SYMFONY_PHPUNIT_REMOVE');
64+
passthru("$COMPOSER remove --no-update ".('' === $SYMFONY_PHPUNIT_REMOVE ?: 'phpspec/prophecy symfony/yaml'));
6465
if (5.1 <= $PHPUNIT_VERSION && $PHPUNIT_VERSION < 5.4) {
6566
passthru("$COMPOSER require --no-update phpunit/phpunit-mock-objects \"~3.1.0\"");
6667
}

‎src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ class ProxyDumper implements DumperInterface
4242
private $classGenerator;
4343

4444
/**
45-
* Constructor.
46-
*
4745
* @param string $salt
4846
*/
4947
public function __construct($salt = '')

‎src/Symfony/Bridge/Twig/Extension/CodeExtension.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Extension/CodeExtension.php
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ class CodeExtension extends AbstractExtension
2727
private $charset;
2828

2929
/**
30-
* Constructor.
31-
*
3230
* @param string|FileLinkFormatter $fileLinkFormat The format for links to source files
3331
* @param string $rootDir The project root directory
3432
* @param string $charset The charset

‎src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/NodeVisitor/TranslationDefaultDomainNodeVisitor.php
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
use Twig\NodeVisitor\AbstractNodeVisitor;
2727

2828
/**
29-
* TranslationDefaultDomainNodeVisitor.
30-
*
3129
* @author Fabien Potencier <fabien@symfony.com>
3230
*/
3331
class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
@@ -37,9 +35,6 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
3735
*/
3836
private $scope;
3937

40-
/**
41-
* Constructor.
42-
*/
4338
public function __construct()
4439
{
4540
$this->scope = new Scope();

‎src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_horizontal_layout.html.twig
-20Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,6 @@ col-sm-2
3434
{##}</div>
3535
{%- endblock form_row %}
3636

37-
{% block checkbox_row -%}
38-
{{- block('checkbox_radio_row') -}}
39-
{%- endblock checkbox_row %}
40-
41-
{% block radio_row -%}
42-
{{- block('checkbox_radio_row') -}}
43-
{%- endblock radio_row %}
44-
45-
{% block checkbox_radio_row -%}
46-
{% spaceless %}
47-
<div class="form-group{% if not valid %} has-error{% endif %}">
48-
<div class="{{ block('form_label_class') }}"></div>
49-
<div class="{{ block('form_group_class') }}">
50-
{{ form_widget(form) }}
51-
{{ form_errors(form) }}
52-
</div>
53-
</div>
54-
{% endspaceless %}
55-
{%- endblock checkbox_radio_row %}
56-
5737
{% block submit_row -%}
5838
{% spaceless %}
5939
<div class="form-group">

0 commit comments

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