8000 Merge branch '2.7' into 2.8 · gnat42/symfony@9188f05 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9188f05

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: fixed CS fixed test fixed CS Remove default match from AbstractConfigCommand::findExtension
2 parents 0c28d75 + 15c37c2 commit 9188f05

File tree

17 files changed

+72
-63
lines changed

17 files changed

+72
-63
lines changed

src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,17 @@ public function getTr F438 ansTests()
8787

8888
// transchoice
8989
array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
90-
'There is no apples', array('count' => 0),),
90+
'There is no apples', array('count' => 0)),
9191
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
92-
'There is 5 apples', array('count' => 5),),
92+
'There is 5 apples', array('count' => 5)),
9393
array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
94-
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony'),),
94+
'There is 5 apples (Symfony)', array('count' => 5, 'name' => 'Symfony')),
9595
array('{% transchoice count with { \'%name%\': \'Symfony\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}',
96-
'There is 5 apples (Symfony)', array('count' => 5),),
96+
'There is 5 apples (Symfony)', array('count' => 5)),
9797
array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
98-
'There is no apples', array('count' => 0),),
98+
'There is no apples', array('count' => 0)),
9999
array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}',
100-
'There is 5 apples',),
100+
'There is 5 apples'),
101101

102102
// trans filter
103103
array('{{ "Hello"|trans }}', 'Hello'),

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,25 @@ protected function listBundles($output)
4545

4646
protected function findExtension($name)
4747
{
48-
$extension = null;
4948
$bundles = $this->initializeBundles();
5049
foreach ($bundles as $bundle) {
51-
$extension = $bundle->getContainerExtension();
50+
if ($name === $bundle->getName()) {
51+
return $bundle->getContainerExtension();
52+
}
5253

53-
if ($extension && ($name === $extension->getAlias() || $name === $bundle->getName())) {
54-
break;
54+
$extension = $bundle->getContainerExtension();
55+
if ($extension && $name === $extension->getAlias()) {
56+
return $extension;
5557
}
5658
}
5759

58-
if (!$extension) {
60+
if ('Bundle' !== substr($name, -6)) {
61+
$message = sprintf('No extensions with configuration available for "%s"', $name);
62+
} else {
5963
$message = sprintf('No extension with alias "%s" is enabled', $name);
60-
if (preg_match('/Bundle$/', $name)) {
61-
$message = sprintf('No extensions with configuration available for "%s"', $name);
62-
}
63-
64-
throw new \LogicException($message);
6564
}
6665

67-
return $extension;
66+
throw new \LogicException($message);
6867
}
6968

7069
public function validateConfiguration(ExtensionInterface $extension, $configuration)

src/Symfony/Component/Debug/DebugClassLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public function loadClass($class)
241241
$i = count($tail) - 1;
242242
$j = count($real) - 1;
243243

244-
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
244+
while (isset($tail[$i], $real[$j]) && $tail[$i] === $real[$j]) {
245245
--$i;
246246
--$j;
247247
}

src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function testClassAlias()
175175
*/
176176
public function testDeprecatedSuper($class, $super, $type)
177177
{
178-
set_error_handler(function() { return false; });
178+
set_error_handler(function () { return false; });
179179
$e = error_reporting(0);
180180
trigger_error('', E_USER_DEPRECATED);
181181

@@ -227,7 +227,7 @@ class_exists('Test\\'.__NAMESPACE__.'\\NonDeprecatedInterfaceClass', true);
227227

228228
public function testDeprecatedSuperInSameNamespace()
229229
{
230-
set_error_handler(function() { return false; });
230+
set_error_handler(function () { return false; });
231231
$e = error_reporting(0);
232232
trigger_error('', E_USER_NOTICE);
233233

@@ -253,7 +253,7 @@ public function testReservedForPhp7()
253253
$this->markTestSkipped('PHP7 already prevents using reserved names.');
254254
}
255255

256-
set_error_handler(function() { return false; });
256+
set_error_handler(function () { return false; });
257257
$e = error_reporting(0);
258258
trigger_error('', E_USER_NOTICE);
259259

src/Symfony/Component/DependencyInjection/DefinitionDecorator.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ public function setFactory($callable)
7878

7979
/**
8080
* {@inheritdoc}
81-
*
8281
*/
8382
public function setFactoryClass($class)
8483
{

src/Symfony/Component/Filesystem/LockHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function lock($blocking = false)
6969
}
7070

7171
// Silence error reporting
72-
set_error_handler(function() {});
72+
set_error_handler(function () {});
7373

7474
if (!$this->handle = fopen($this->file, 'r')) {
7575
if ($this->handle = fopen($this->file, 'x')) {

src/Symfony/Component/Finder/Tests/FinderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,7 @@ public function testRegexSpecialCharsLocationWithPathRestrictionContainingStartF
527527
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'r+e.gex[c]a(r)s')
528528
->path('/^dir/');
529529

530-
$expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir',
531-
'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat',);
530+
$expected = array('r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir', 'r+e.gex[c]a(r)s'.DIRECTORY_SEPARATOR.'dir'.DIRECTORY_SEPARATOR.'bar.dat');
532531
$this->assertIterator($this->toAbsoluteFixtures($expected), $finder);
533532
}
534533

src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ protected function setUp()
4343
'category' => array(
4444
'fishing' => array(
4545
'first' => 'cod',
46-
'second' => 'sole',),
46+
'second' => 'sole',
4747
),
48+
),
4849
);
4950
$this->bag = new AttributeBag('_sf2');
5051
$this->bag->initialize($this->array);

src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ protected function setUp()
4343
'category' => array(
4444
'fishing' => array(
4545
'first' = E2D4 > 'cod',
46-
'second' => 'sole',),
46+
'second' => 'sole',
4747
),
48+
),
4849
);
4950
$this->bag = new NamespacedAttributeBag('_sf2', '/');
5051
$this->bag->initialize($this->array);

src/Symfony/Component/OptionsResolver/Tests/OptionsResolver2Dot6Test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,7 @@ public function testCatchedExceptionFromNormalizerDoesNotCrashOptionResolver()
11021102
$this->resolver->setNormalizer('catcher', function (Options $options) {
11031103
try {
11041104
return $options['thrower'];
1105-
} catch(\Exception $e) {
1105+
} catch (\Exception $e) {
11061106
return false;
11071107
}
11081108
});
@@ -1126,7 +1126,7 @@ public function testCatchedExceptionFromLazyDoesNotCrashOptionResolver()
11261126
$this->resolver->setDefault('catcher', function (Options $options) {
11271127
try {
11281128
return $options['thrower'];
1129-
} catch(\Exception $e) {
1129+
} catch (\Exception $e) {
11301130
return false;
11311131
}
11321132
});

0 commit comments

Comments
 (0)
0