Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c1de3f

Browse files
Merge branch '3.4'
* 3.4: [HttpFoundation] refactoring: calculate when need [Serializer] Fix extra attributes when no group specified [Intl] Make intl-data tests pass and save language aliases again [FrameworkBundle][Config] fix: do not add resource checkers for debug=false [DI] Fix "almost-circular" dependencies handling [Console] Fix CommandTester::setInputs() docblock Only enabling validation if it is present Fix displaying errors for bootstrap 4 [Serializer] readd default argument value Fix reference dump for deprecated nodes [PhpUnitBridge] Fixed fatal error in CoverageListener when something goes wrong in Test::setUpBeforeClass [HttpKernel] Let the storage manage the session starts [VarDumper] fix trailling comma when dumping an exception [Validator] Fix TraceableValidator is reset on data collector instantiation Remove useless docblocks [FrameworkBundle] Fix docblocks [PropertyInfo] Remove useless docblocks
2 parents a522e04 + 7398276 commit 4c1de3f

File tree

217 files changed

+1919
-2367
lines changed

Some content is hidden

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

217 files changed

+1919
-2367
lines changed

src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/DoctrineValidationPass.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
*/
2222
class DoctrineValidationPass implements CompilerPassInterface
2323
{
24-
/**
25-
* @var string
26-
*/
2724
private $managerType;
2825

26+
/**
27+
* @param string $managerType
28+
*/
2929
public function __construct($managerType)
3030
{
3131
$this->managerType = $managerType;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
113113
* present to enable the mapping. Set to false
114114
* to not do any check, optional.
115115
* @param string $configurationPattern Pattern for the Configuration service name
116-
* @param string $registerAliasMethodName name of Configuration class method to
116+
* @param string $registerAliasMethodName Name of Configuration class method to
117117
* register alias
118118
* @param string[] $aliasMap Map of alias to namespace
119119
*/
@@ -178,7 +178,7 @@ protected function getChainDriverServiceName(ContainerBuilder $container)
178178
/**
179179
* Create the service definition for the metadata driver.
180180
*
181-
* @param ContainerBuilder $container passed on in case an extending class
181+
* @param ContainerBuilder $container Passed on in case an extending class
182182
* needs access to the container
183183
*
184184
* @return Definition|Reference the metadata driver to add to all chain drivers

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,9 @@
2424
*/
2525
class DoctrineChoiceLoader implements ChoiceLoaderInterface
2626
{
27-
/**
28-
* @var ObjectManager
29-
*/
3027
private $manager;
31-
32-
/**
33-
* @var string
34-
*/
3528
private $class;
36-
37-
/**
38-
* @var IdReader
39-
*/
4029
private $idReader;
41-
42-
/**
43-
* @var null|EntityLoaderInterface
44-
*/
4530
private $objectLoader;
4631

4732
/**
@@ -57,13 +42,10 @@ class DoctrineChoiceLoader implements ChoiceLoaderInterface
5742
* mapper implementations.
5843
*
5944
* @param ObjectManager $manager The object manager
60-
* @param string $class The class name of the
61-
* loaded objects
62-
* @param IdReader $idReader the reader for the object
63-
* IDs
45+
* @param string $class The class name of the loaded objects
46+
* @param IdReader $idReader The reader for the object IDs
6447
* @param null|EntityLoaderInterface $objectLoader The objects loader
65-
* @param ChoiceListFactoryInterface $factory The factory for creating
66-
* the loaded choice list
48+
* @param ChoiceListFactoryInterface $factory The factory for creating the loaded choice list
6749
*/
6850
public function __construct(ObjectManager $manager, $class, $idReader = null, $objectLoader = null, $factory = null)
6951
{

src/Symfony/Bridge/Doctrine/Form/ChoiceList/IdReader.php

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,10 @@
2424
*/
2525
class IdReader
2626
{
27-
/**
28-
* @var ObjectManager
29-
*/
3027
private $om;
31-
32-
/**
33-
* @var ClassMetadata
34-
*/
3528
private $classMetadata;
36-
37-
/**
38-
* @var bool
39-
*/
4029
private $singleId;
41-
42-
/**
43-
* @var bool
44-
*/
4530
private $intId;
46-
47-
/**
48-
* @var string
49-
*/
5031
private $idField;
5132

5233
/**

src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
*/
2828
class DoctrineExtractor implements PropertyListExtractorInterface, PropertyTypeExtractorInterface
2929
{
30-
/**
31-
* @var ClassMetadataFactory
32-
*/
3330
private $classMetadataFactory;
3431

3532
public function __construct(ClassMetadataFactory $classMetadataFactory)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
*/
2727
class UniqueEntityValidator extends ConstraintValidator
2828
{
29-
/**
30-
* @var ManagerRegistry
31-
*/
3229
private $registry;
3330

3431
public function __construct(ManagerRegistry $registry)

src/Symfony/Bridge/PhpUnit/Legacy/CoverageListenerTrait.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bridge\PhpUnit\Legacy;
1313

1414
use PHPUnit\Framework\Test;
15+
use PHPUnit\Framework\TestCase;
1516
use PHPUnit\Framework\Warning;
1617

1718
/**
@@ -36,6 +37,10 @@ public function __construct(callable $sutFqcnResolver = null, $warningOnSutNotFo
3637

3738
public function startTest($test)
3839
{
40+
if (!$test instanceof TestCase) {
41+
return;
42+
}
43+
3944
$annotations = $test->getAnnotations();
4045

4146
$ignoredAnnotations = array('covers', 'coversDefaultClass', 'coversNothing');

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,8 @@
2626
*/
2727
class ProxyDumper implements DumperInterface
2828
{
29-
/**
30-
* @var string
31-
*/
3229
private $salt;
33-
34-
/**
35-
* @var LazyLoadingValueHolderGenerator
36-
*/
3730
private $proxyGenerator;
38-
39-
/**
40-
* @var BaseGeneratorStrategy
41-
*/
4231
private $classGenerator;
4332

4433
/**

src/Symfony/Bridge/Twig/Extension/StopwatchExtension.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
class StopwatchExtension extends AbstractExtension
2424
{
2525
private $stopwatch;
26-
27-
/**
28-
* @var bool
29-
*/
3026
private $enabled;
3127

3228
public function __construct(Stopwatch $stopwatch = null, $enabled = true)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030
*/
3131
class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
3232
{
33-
/**
34-
* @var Scope
35-
*/
3633
private $scope;
3734

3835
public function __construct()

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,54 @@
22

33
{# Widgets #}
44

5+
{% block money_widget -%}
6+
{% if not valid %}
7+
{% set group_class = ' form-control is-invalid' %}
8+
{% set valid = true %}
9+
{% endif %}
10+
{{- parent() -}}
11+
{%- endblock money_widget %}
12+
13+
{% block datetime_widget -%}
14+
{%- if widget != 'single_text' and not valid -%}
15+
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%}
16+
{% set valid = true %}
17+
{%- endif -%}
18+
{{- parent() -}}
19+
{%- endblock datetime_widget %}
20+
21+
{% block date_widget -%}
22+
{%- if widget != 'single_text' and not valid -%}
23+
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%}
24+
{% set valid = true %}
25+
{%- endif -%}
26+
{{- parent() -}}
27+
{%- endblock date_widget %}
28+
29+
{% block time_widget -%}
30+
{%- if widget != 'single_text' and not valid -%}
31+
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%}
32+
{% set valid = true %}
33+
{%- endif -%}
34+
{{- parent() -}}
35+
{%- endblock time_widget %}
36+
37+
{% block dateinterval_widget -%}
38+
{%- if widget != 'single_text' and not valid -%}
39+
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) -%}
40+
{% set valid = true %}
41+
{%- endif -%}
42+
{{- parent() -}}
43+
{%- endblock dateinterval_widget %}
44+
45+
{% block percent_widget -%}
46+
<div class="input-group{{ not valid ? ' form-control is-invalid' }}">
47+
{% set valid = true %}
48+
{{- block('form_widget_simple') -}}
49+
<span class="input-group-addon">%</span>
50+
</div>
51+
{%- endblock percent_widget %}
52+
553
{% block form_widget_simple -%}
654
{% if type is not defined or type != 'hidden' %}
755
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control' ~ (type|default('') == 'file' ? '-file' : ''))|trim}) -%}
@@ -11,7 +59,7 @@
1159

1260
{%- block widget_attributes -%}
1361
{%- if not valid %}
14-
{% set attr = attr|merge({class: (attr.class|default('') ~ ' is-invalid')|trim}) %}
62+
{% set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) %}
1563
{% endif -%}
1664
{{ parent() }}
1765
{%- endblock widget_attributes -%}
@@ -27,7 +75,7 @@
2775
{% if 'checkbox-inline' in parent_label_class %}
2876
{{- form_label(form, null, { widget: parent() }) -}}
2977
{% else -%}
30-
<div class="form-check">
78+
<div class="form-check{{ not valid ? ' form-control is-invalid' }}">
3179
{{- form_label(form, null, { widget: parent() }) -}}
3280
</div>
3381
{%- endif -%}
@@ -39,7 +87,7 @@
3987
{%- if 'radio-inline' in parent_label_class -%}
4088
{{- form_label(form, null, { widget: parent() }) -}}
4189
{%- else -%}
42-
<div class="form-check">
90+
<div class="form-check{{ not valid ? ' form-control is-invalid' }}">
4391
{{- form_label(form, null, { widget: parent() }) -}}
4492
</div>
4593
{%- endif -%}
@@ -55,6 +103,9 @@
55103
}) -}}
56104
{% endfor -%}
57105
{%- else -%}
106+
{%- if not valid -%}
107+
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control is-invalid')|trim}) %}
108+
{%- endif -%}
58109
<div {{ block('widget_container_attributes') }}>
59110
{%- for child in form %}
60111
{{- form_widget(child, {

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_base_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{%- endblock textarea_widget %}
99

1010
{% block money_widget -%}
11-
<div class="input-group">
11+
<div class="input-group{{ group_class|default('') }}">
1212
{%- set append = money_pattern starts with '{{' -%}
1313
{%- if not append -%}
1414
<span class="input-group-addon">{{ money_pattern|replace({ '{{ widget }}':''}) }}</span>

src/Symfony/Bridge/Twig/Translation/TwigExtractor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ class TwigExtractor extends AbstractFileExtractor implements ExtractorInterface
4242
*/
4343
private $prefix = '';
4444

45-
/**
46-
* The twig environment.
47-
*
48-
* @var Environment
49-
*/
5045
private $twig;
5146

5247
public function __construct(Environment $twig)

src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Controller;
1313

14+
use Doctrine\Common\Persistence\ManagerRegistry;
1415
use Psr\Container\ContainerInterface;
1516
use Symfony\Component\HttpFoundation\BinaryFileResponse;
1617
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -23,10 +24,9 @@
2324
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
2425
use Symfony\Component\Security\Csrf\CsrfToken;
2526
use Symfony\Component\Form\Extension\Core\Type\FormType;
26-
use Symfony\Component\Form\Form;
27-
use Symfony\Component\Form\FormBuilder;
27+
use Symfony\Component\Form\FormInterface;
28+
use Symfony\Component\Form\FormBuilderInterface;
2829
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
29-
use Doctrine\Bundle\DoctrineBundle\Registry;
3030

3131
/**
3232
* Common features needed in controllers.
@@ -71,7 +71,7 @@ protected function get($id)
7171
* Generates a URL from the given parameters.
7272
*
7373
* @param string $route The name of the route
74-
* @param mixed $parameters An array of parameters
74+
* @param array $parameters An array of parameters
7575
* @param int $referenceType The type of reference (one of the constants in UrlGeneratorInterface)
7676
*
7777
* @return string The generated URL
@@ -380,7 +380,7 @@ protected function createAccessDeniedException($message = 'Access Denied.', \Exc
380380
* @param mixed $data The initial data for the form
381381
* @param array $options Options for the form
382382
*
383-
* @return Form
383+
* @return FormInterface
384384
*
385385
* @final since version 3.4
386386
*/
@@ -395,7 +395,7 @@ protected function createForm($type, $data = null, array $options = array())
395395
* @param mixed $data The initial data for the form
396396
* @param array $options Options for the form
397397
*
398-
* @return FormBuilder
398+
* @return FormBuilderInterface
399399
*
400400
* @final since version 3.4
401401
*/
@@ -407,7 +407,7 @@ protected function createFormBuilder($data = null, array $options = array())
407407
/**
408408
* Shortcut to return the Doctrine Registry service.
409409
*
410-
* @return Registry
410+
* @return ManagerRegistry
411411
*
412412
* @throws \LogicException If DoctrineBundle is not available
413413
*

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,10 @@ public function load(array $configs, ContainerBuilder $container)
193193
if ($this->isConfigEnabled($container, $config['form'])) {
194194
$this->formConfigEnabled = true;
195195
$this->registerFormConfiguration($config, $container, $loader);
196-
$config['validation']['enabled'] = true;
197196

198-
if (!class_exists('Symfony\Component\Validator\Validation')) {
197+
if (class_exists('Symfony\Component\Validator\Validation')) {
198+
$config['validation']['enabled'] = true;
199+
} else {
199200
$container->setParameter('validator.translation_domain', 'validators');
200201

201202
$container->removeDefinition('form.type_extension.form.validator');
@@ -312,6 +313,11 @@ public function load(array $configs, ContainerBuilder $container)
312313
->addTag('validator.constraint_validator');
313314
$container->registerForAutoconfiguration(ObjectInitializerInterface::class)
314315
->addTag('validator.initializer');
316+
317+
if (!$container->getParameter('kernel.debug')) {
318+
// remove tagged iterator argument for resource checkers
319+
$container->getDefinition('config_cache_factory')->setArguments(array());
320+
}
315321
}
316322

317323
/**

src/Symfony/Bundle/FrameworkBundle/Resources/config/validator_debug.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<service id="debug.validator" decorates="validator" decoration-priority="255" class="Symfony\Component\Validator\Validator\TraceableValidator">
1111
<argument type="service" id="debug.validator.inner" />
12+
<tag name="kernel.reset" method="reset" />
1213
</service>
1314

1415
<!-- DataCollector -->

0 commit comments

Comments
 (0)