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

Skip to content

Commit 7cf96a4

Browse files
committed
feature #31082 [Form] Show all option normalizers on debug:form command (yceruto)
This PR was merged into the 4.3-dev branch. Discussion ---------- [Form] Show all option normalizers on debug:form command | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT Follow-up #30371 ![normalizers](https://user-images.githubusercontent.com/2028198/55996454-6667df80-5c85-11e9-94f6-9ee3988833f3.png) Commits ------- f1d3bc0 Show all option normalizers on debug:form command
2 parents e683dfa + f1d3bc0 commit 7cf96a4

9 files changed

+74
-65
lines changed

src/Symfony/Component/Form/Console/Descriptor/Descriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ protected function getOptionDefinition(OptionsResolver $optionsResolver, $option
120120
'lazy' => 'getLazyClosures',
121121
'allowedTypes' => 'getAllowedTypes',
122122
'allowedValues' => 'getAllowedValues',
123-
'normalizer' => 'getNormalizer',
123+
'normalizers' => 'getNormalizers',
124124
'deprecationMessage' => 'getDeprecationMessage',
125125
];
126126

src/Symfony/Component/Form/Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ protected function describeOption(OptionsResolver $optionsResolver, array $optio
8787
}
8888
}
8989
}
90-
$data['has_normalizer'] = isset($definition['normalizer']);
90+
$data['has_normalizer'] = isset($definition['normalizers']);
9191

9292
$this->writeData($data, $options);
9393
}

src/Symfony/Component/Form/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected function describeOption(OptionsResolver $optionsResolver, array $optio
118118
'Default' => 'default',
119119
'Allowed types' => 'allowedTypes',
120120
'Allowed values' => 'allowedValues',
121-
'Normalizer' => 'normalizer',
121+
'Normalizers' => 'normalizers',
122122
];
123123
$rows = [];
124124
foreach ($map as $label => $name) {

src/Symfony/Component/Form/Tests/Command/DebugCommandTest.php

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,27 +164,29 @@ public function testDebugCustomFormTypeOption()
164164
Symfony\Component\Form\Tests\Command\FooType (foo)
165165
==================================================
166166
167-
---------------- -----------------------------------------------------------%s
168-
Required true %w
169-
---------------- -----------------------------------------------------------%s
170-
Default - %w
171-
---------------- -----------------------------------------------------------%s
172-
Allowed types [ %w
173-
"string" %w
174-
] %w
175-
---------------- -----------------------------------------------------------%s
176-
Allowed values [ %w
177-
"bar", %w
178-
"baz" %w
179-
] %w
180-
---------------- -----------------------------------------------------------%s
181-
Normalizer Closure(Options $options, $value) { %w
182-
class: "Symfony\Component\Form\Tests\Command\FooType" %w
183-
this: Symfony\Component\Form\Tests\Command\FooType { …} %w
184-
file: "%s"%w
185-
line: "%d to %d"%w
186-
} %w
187-
---------------- -----------------------------------------------------------%s
167+
---------------- -----------%s
168+
Required true %s
169+
---------------- -----------%s
170+
Default - %s
171+
---------------- -----------%s
172+
Allowed types [ %s
173+
"string"%s
174+
] %s
175+
---------------- -----------%s
176+
Allowed values [ %s
177+
"bar", %s
178+
"baz" %s
179+
] %s
180+
---------------- -----------%s
181+
Normalizers [ %s
182+
Closure(%s
183+
class:%s
184+
this: %s
185+
file: %s
186+
line: %s
187+
} %s
188+
] %s
189+
---------------- -----------%s
188190

189191
TXT
190192
, $tester->getDisplay(true));

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/default_option_with_normalizer.txt

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@
22
Symfony\Component\Form\Extension\Core\Type\ChoiceType (choice_translation_domain)
33
=================================================================================
44

5-
---------------- --------------------%s
6-
Required false %s
7-
---------------- --------------------%s
8-
Default true %s
9-
---------------- --------------------%s
10-
Allowed types [ %s
11-
"null", %s
12-
"bool", %s
13-
"string" %s
14-
] %s
15-
---------------- --------------------%s
16-
Allowed values - %s
17-
---------------- --------------------%s
18-
Normalizer Closure%s{%A
19-
file: "%s%eExtension%eCore%eType%eChoiceType.php"%w
20-
line: %s
21-
} %s
22-
---------------- --------------------%s
5+
---------------- -----------%s
6+
Required false %s
7+
---------------- -----------%s
8+
Default true %s
9+
---------------- -----------%s
10+
Allowed types [ %s
11+
"null", %s
12+
"bool", %s
13+
"string"%s
14+
] %s
15+
---------------- -----------%s
16+
Allowed values - %s
17+
---------------- -----------%s
18+
Normalizers [ %s
19+
Closure(%s
20+
class:%s
21+
this: %s
22+
file: %s
23+
line: %s
24+
} %s
25+
] %s
26+
---------------- -----------%s
2327

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/deprecated_option.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (bar)
1414
--------------------- -----------------------------------
1515
Allowed values -
1616
--------------------- -----------------------------------
17-
Normalizer -
17+
Normalizers -
1818
--------------------- -----------------------------------

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/overridden_option_with_default_closures.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data)
32
====================================================================
43

@@ -22,6 +21,6 @@ Symfony\Component\Form\Tests\Console\Descriptor\FooType (empty_data)
2221
---------------- ----------------------%s
2322
Allowed values - %s
2423
---------------- ----------------------%s
25-
Normalizer - %s
24+
Normalizers - %s
2625
---------------- ----------------------%s
2726

src/Symfony/Component/Form/Tests/Fixtures/Descriptor/required_option_with_allowed_values.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22
Symfony\Component\Form\Tests\Console\Descriptor\FooType (foo)
33
=============================================================
44

5-
---------------- --------------------%s
6-
Required true %s
7-
---------------- --------------------%s
8-
Default - %s
9-
---------------- --------------------%s
10-
Allowed types [ %s
11-
"string" %s
12-
] %s
13-
---------------- --------------------%s
14-
Allowed values [ %s
15-
"bar", %s
16-
"baz" %s
17-
] %s
18-
---------------- --------------------%s
19-
Normalizer Closure%s{%A
20-
file: "%s%eTests%eConsole%eDescriptor%eAbstractDescriptorTest.php"%w
21-
line: %s
22-
} %s
23-
---------------- --------------------%s
5+
---------------- -----------%s
6+
Required true %s
7+
---------------- -----------%s
8+
Default - %s
9+
---------------- -----------%s
10+
Allowed types [ %s
11+
"string"%s
12+
] %s
13+
---------------- -----------%s
14+
Allowed values [ %s
15+
"bar", %s
16+
"baz" %s
17+
] %s
18+
---------------- -----------%s
19+
Normalizers [ %s
20+
Closure(%s
21+
class:%s
22+
this: %s
23+
file: %s
24+
line: %s
25+
} %s
26+
] %s
27+
---------------- -----------%s
2428

src/Symfony/Component/Form/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": "^7.1.3",
2020
"symfony/event-dispatcher": "^4.3",
2121
"symfony/intl": "^4.3",
22-
"symfony/options-resolver": "~4.2",
22+
"symfony/options-resolver": "~4.3",
2323
"symfony/polyfill-ctype": "~1.8",
2424
"symfony/polyfill-mbstring": "~1.0",
2525
"symfony/property-access": "~3.4|~4.0"

0 commit comments

Comments
 (0)