8000 Merge branch '2.3' into 2.7 · symfony/symfony@ced865d · GitHub
[go: up one dir, main page]

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 ced865d

Browse files
committed
Merge branch '2.3' into 2.7
* 2.3: fixed YAML files missing quotes when a string starts with @ [Routing] mark internal classes [Translation][Csv file] remove unnecessary statements, for better readability. [Form] remove validation of FormRegistry::getType as FormRegistry::hasType does not validate either
2 parents f042197 + 95ff0bc commit ced865d

File tree

17 files changed

+24
-53
lines changed

17 files changed

+24
-53
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_fragmenttest_bundle:
2-
resource: @TestBundle/Resources/config/routing.yml
2+
resource: '@TestBundle/Resources/config/routing.yml'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_sessiontest_bundle:
2-
resource: @TestBundle/Resources/config/routing.yml
2+
resource: '@TestBundle/Resources/config/routing.yml'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_sessiontest_bundle:
2-
resource: @TestBundle/Resources/config/routing.yml
2+
resource: '@TestBundle/Resources/config/routing.yml'

8000 src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
class: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginFormType
77
scope: request
88
arguments:
9-
- @request
9+
- '@request'
1010
tags:
1111
- { name: form.type, alias: user_login }
1212

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
_csrf_form_login_bundle:
2-
resource: @CsrfFormLoginBundle/Resources/config/routing.yml
2+
resource: '@CsrfFormLoginBundle/Resources/config/routing.yml'
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
_form_login_bundle:
2-
resource: @FormLoginBundle/Resources/config/routing.yml
2+
resource: '@FormLoginBundle/Resources/config/routing.yml'
33

44
_form_login_localized:
5-
resource: @FormLoginBundle/Resources/config/localized_routing.yml
5+
resource: '@FormLoginBundle/Resources/config/localized_routing.yml'

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ private function addService($id, $definition)
162162
private function addServiceAlias($alias, $id)
163163
{
164164
if ($id->isPublic()) {
165-
return sprintf(" %s: @%s\n", $alias, $id);
166-
} else {
167-
return sprintf(" %s:\n alias: %s\n public: false", $alias, $id);
165+
return sprintf(" %s: '@%s'\n", $alias, $id);
168166
}
167+
168+
return sprintf(" %s:\n alias: %s\n public: false", $alias, $id);
169169
}
170170

171171
/**

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
- 0
77
- 1000.3
88
bar: foo
9-
escape: @@escapeme
10-
foo_bar: @foo_bar
9+
escape: '@@escapeme'
10+
foo_bar: '@foo_bar'
1111
MixedCase:
1212
MixedCaseKey: value

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

Lines changed: 3 additions & 3 deletions
scope.custom: { class: FooClass, scope: custom }
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
66
scope.prototype: { class: FooClass, scope: prototype }
77
file: { class: FooClass, file: %path%/foo.php }
8-
arguments: { class: FooClass, arguments: [foo, @foo, [true, false]] }
8+
arguments: { class: FooClass, arguments: [foo, '@foo', [true, false]] }
99
configurator1: { class: FooClass, configurator: sc_configure }
1010
configurator2: { class: FooClass, configurator: [@baz, configure] }
1111
configurator3: { class: FooClass, configurator: [BazClass, configureStatic] }
@@ -18,8 +18,8 @@ services:
1818
method_call2:
1919
class: FooClass
2020
calls:
21-
- [ setBar, [ foo, @foo, [true, false] ] ]
22-
alias_for_foo: @foo
21+
- [ setBar, [ foo, '@foo', [true, false] ] ]
22+
alias_for_foo: '@foo'
2323
another_alias_for_foo:
2424
alias: foo
2525
public: false

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,5 +90,5 @@ services:
9090
service_from_static_method:
9191
class: Bar\FooClass
9292
factory: [Bar\FooClass, getInstance]
93-
alias_for_foo: @foo
94-
alias_for_alias: @foo
93+
alias_for_foo: '@foo'
94+
alias_for_alias: '@foo'

src/Symfony/Component/Form/FormRegistry.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ public function __construct(array $extensions, ResolvedFormTypeFactoryInterface
6969
*/
7070
public function getType($name)
7171
{
72-
if (!is_string($name)) {
73-
throw new UnexpectedTypeException($name, 'string');
74-
}
75-
7672
if (!isset($this->types[$name])) {
7773
$type = null;
7874

src/Symfony/Component/Form/FormRegistryInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ interface FormRegistryInterface
2727
*
2828
* @return ResolvedFormTypeInterface The type
2929
*
30-
* @throws Exception\UnexpectedTypeException if the passed name is not a string
3130
* @throws Exception\InvalidArgumentException if the type can not be retrieved from any extension
3231
*/
3332
public function getType($name);

src/Symfony/Component/Form/Tests/FormRegistryTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ public function testGetTypeConnectsParentIfGetParentReturnsInstance()
172172
$this->assertSame($resolvedType, $this->registry->getType('foo_sub_type_parent_instance'));
173173
}
174174

175-
/**
176-
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
177-
*/
178-
public function testGetTypeThrowsExceptionIfParentNotFound()
179-
{
180-
$type = new FooSubType();
181-
182-
$this->extension1->addType($type);
183-
184-
$this->registry->getType($type);
185-
}
186-
187175
/**
188176
* @expectedException \Symfony\Component\Form\Exception\InvalidArgumentException
189177
*/
@@ -192,14 +180,6 @@ public function testGetTypeThrowsExceptionIfTypeNotFound()
192180
$this->registry->getType('bar');
193181
}
194182

195-
/**
196-
* @expectedException \Symfony\Compon F987 ent\Form\Exception\UnexpectedTypeException
197-
*/
198-
public function testGetTypeThrowsExceptionIfNoString()
199-
{
200-
$this->registry->getType(array());
201-
}
202-
203183
public function testHasTypeAfterLoadingFromExtension()
204184
{
205185
$type = new FooType();

src/Symfony/Component/Routing/Matcher/Dumper/DumperCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Collection of routes.
1616
*
1717
* @author Arnaud Le Blanc <arnaud.lb@gmail.com>
18+
*
19+
* @internal
1820
*/
1921
class DumperCollection implements \IteratorAggregate
2022
{

src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* Prefix tree of routes preserving routes order.
1616
*
1717
* @author Arnaud Le Blanc <arnaud.lb@gmail.com>
18+
*
19+
* @internal
1820
*/
1921
class DumperPrefixCollection extends DumperCollection
2022
{

src/Symfony/Component/Routing/Matcher/Dumper/DumperRoute.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* Container for a Route.
1818
*
1919
* @author Arnaud Le Blanc <arnaud.lb@gmail.com>
20+
*
21+
* @internal
2022
*/
2123
class DumperRoute
2224
{

src/Symfony/Component/Translation/Loader/CsvFileLoader.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,8 @@ public function load($resource, $locale, $domain = 'messages')
5151
$file->setCsvControl($this->delimiter, $this->enclosure, $this->escape);
5252

5353
foreach ($file as $data) {
54-
if (substr($data[0], 0, 1) === '#') {
55-
continue;
56-
}
57-
58-
if (!isset($data[1])) {
59-
continue;
60-
}
61-
62-
if (count($data) == 2) {
54+
if ('#' !== substr($data[0], 0, 1) && isset($data[1]) && 2 === count($data)) {
6355
$messages[$data[0]] = $data[1];
64-
} else {
65-
continue;
6656
}
6757
}
6858

0 commit comments

Comments
 (0)
0