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 1a95710

Browse filesBrowse files
committed
Merge branch '3.2'
* 3.2: [Config] removed obsolete code [Form] Improve rounding precision [Routing] Ignore hidden directories when loading routes from annotations fixed CS
2 parents 50b9126 + 86675f3 commit 1a95710
Copy full SHA for 1a95710

File tree

16 files changed

+70
-14
lines changed
Filter options

16 files changed

+70
-14
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/src/CustomPathBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/CustomPathBundle/src/CustomPathBundle.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests;
1313

14-
class CustomPathBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
14+
use Symfony\Component\HttpKernel\Bundle\Bundle;
15+
16+
class CustomPathBundle extends Bundle
1517
{
1618
public function getPath()
1719
{

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests;
1313

14-
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
14+
use Symfony\Component\HttpKernel\Bundle\Bundle;
15+
16+
class TestBundle extends Bundle
1517
{
1618
}

‎src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ private function round($number)
242242
if (null !== $this->scale && null !== $this->roundingMode) {
243243
// shift number to maintain the correct scale during rounding
244244
$roundingCoef = pow(10, $this->scale);
245-
$number *= $roundingCoef;
245+
// string representation to avoid rounding errors, similar to bcmul()
246+
$number = (string) ($number * $roundingCoef);
246247

247248
switch ($this->roundingMode) {
248249
case self::ROUND_CEILING:

‎src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
namespace Symfony\Component\Form\Extension\Validator\Util;
1313

14+
use Symfony\Component\Form\Util\ServerParams as BaseServerParams;
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*/
17-
class ServerParams extends \Symfony\Component\Form\Util\ServerParams
19+
class ServerParams extends BaseServerParams
1820
{
1921
}

‎src/Symfony/Component/Form/Tests/AbstractLayoutTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
use Symfony\Component\Form\FormError;
1515
use Symfony\Component\Form\FormView;
1616
use Symfony\Component\Form\Extension\Csrf\CsrfExtension;
17+
use Symfony\Component\Form\Test\FormIntegrationTestCase;
1718

18-
abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormIntegrationTestCase
19+
abstract class AbstractLayoutTest extends FormIntegrationTestCase
1920
{
2021
protected $csrfTokenManager;
2122
protected $testableFeatures = array();

‎src/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/CompoundFormPerformanceTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111

1212
namespace Symfony\Component\Form\Tests;
1313

14+
use Symfony\Component\Form\Test\FormPerformanceTestCase;
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*/
17-
class CompoundFormPerformanceTest extends \Symfony\Component\Form\Test\FormPerformanceTestCase
19+
class CompoundFormPerformanceTest extends FormPerformanceTestCase
1820
{
1921
/**
2022
* Create a compound form multiple times, as happens in a collection form.

‎src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ public function reverseTransformWithRoundingProvider()
305305
array(1, '123,44', 123.4, NumberToLocalizedStringTransformer::ROUND_DOWN),
306306
array(1, '-123,45', -123.4, NumberToLocalizedStringTransformer::ROUND_DOWN),
307307
array(1, '-123,44', -123.4, NumberToLocalizedStringTransformer::ROUND_DOWN),
308+
array(2, '37.37', 37.37, NumberToLocalizedStringTransformer::ROUND_DOWN),
309+
array(2, '2.01', 2.01, NumberToLocalizedStringTransformer::ROUND_DOWN),
308310
// round halves (.5) to the next even number
309311
array(0, '1234,6', 1235, NumberToLocalizedStringTransformer::ROUND_HALF_EVEN),
310312
array(0, '1234,5', 1234, NumberToLocalizedStringTransformer::ROUND_HALF_EVEN),

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14+
use Symfony\Component\Form\Test\TypeTestCase;
15+
1416
/**
1517
* @author Bernhard Schussek <bschussek@gmail.com>
1618
*/
17-
abstract class BaseTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
19+
abstract class BaseTypeTest extends TypeTestCase
1820
{
1921
public function testPassDisabledAsOption()
2022
{

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/CheckboxTypeTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\CallbackTransformer;
15+
use Symfony\Component\Form\Test\TypeTestCase;
1516

16-
class CheckboxTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
17+
class CheckboxTypeTest extends TypeTestCase
1718
{
1819
public function testDataIsFalseByDefault()
1920
{

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/CollectionTypeTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14+
use Symfony\Component\Form\Test\TypeTestCase;
1415
use Symfony\Component\Form\Tests\Fixtures\Author;
1516

16-
class CollectionTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
17+
class CollectionTypeTest extends TypeTestCase
1718
{
1819
public function testContainsNoChildByDefault()
1920
{

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/FileTypeTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class FileTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
14+
use Symfony\Component\Form\Test\TypeTestCase;
15+
16+
class FileTypeTest extends TypeTestCase
1517
{
1618
// https://github.com/symfony/symfony/pull/5028
1719
public function testSetData()

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/PasswordTypeTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class PasswordTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
14+
use Symfony\Component\Form\Test\TypeTestCase;
15+
16+
class PasswordTypeTest extends TypeTestCase
1517
{
1618
public function testEmptyIfNotSubmitted()
1719
{

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

14-
class RepeatedTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
14+
use Symfony\Component\Form\Test\TypeTestCase;
15+
16+
class RepeatedTypeTest extends TypeTestCase
1517
{
1618
protected $form;
1719

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Tests/Extension/Core/Type/TimezoneTypeTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
namespace Symfony\Component\Form\Tests\Extension\Core\Type;
1313

1414
use Symfony\Component\Form\ChoiceList\View\ChoiceView;
15+
use Symfony\Component\Form\Test\TypeTestCase;
1516

16-
class TimezoneTypeTest extends \Symfony\Component\Form\Test\TypeTestCase
17+
class TimezoneTypeTest extends TypeTestCase
1718
{
1819
public function testTimezonesAreSelectable()
1920
{

‎src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Loader/AnnotationDirectoryLoader.php
+9-1Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ public function load($path, $type = null)
3838

3939
$collection = new RouteCollection();
4040
$collection->addResource(new DirectoryResource($dir, '/\.php$/'));
41-
$files = iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY));
41+
$files = iterator_to_array(new \RecursiveIteratorIterator(
42+
new \RecursiveCallbackFilterIterator(
43+
new \RecursiveDirectoryIterator($dir),
44+
function (\SplFileInfo $current) {
45+
return '.' !== substr($current->getBasename(), 0, 1);
46+
}
47+
),
48+
\RecursiveIteratorIterator::LEAVES_ONLY
49+
));
4250
usort($files, function (\SplFileInfo $a, \SplFileInfo $b) {
4351
return (string) $a > (string) $b ? 1 : -1;
4452
});

‎src/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/Loader/AnnotationDirectoryLoaderTest.php
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ public function testLoad()
4040
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses');
4141
}
4242

43+
public function testLoadIgnoresHiddenDirectories()
44+
{
45+
$this->expectAnnotationsToBeReadFrom(array(
46+
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass',
47+
'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\FooClass',
48+
));
49+
50+
$this->reader
51+
->expects($this->any())
52+
->method('getMethodAnnotations')
53+
->will($this->returnValue(array()))
54+
;
55+
56+
$this->loader->load(__DIR__.'/../Fixtures/AnnotatedClasses');
57+
}
58+
4359
public function testSupports()
4460
{
4561
$fixturesDir = __DIR__.'/../Fixtures';
@@ -50,4 +66,13 @@ public function testSupports()
5066
$this->assertTrue($this->loader->supports($fixturesDir, 'annotation'), '->supports() checks the resource type if specified');
5167
$this->assertFalse($this->loader->supports($fixturesDir, 'foo'), '->supports() checks the resource type if specified');
5268
}
69+
70+
private function expectAnnotationsToBeReadFrom(array $classes)
71+
{
72+
$this->reader->expects($this->exactly(count($classes)))
73+
->method('getClassAnnotation')
74+
->with($this->callback(function (\ReflectionClass $class) use ($classes) {
75+
return in_array($class->getName(), $classes);
76+
}));
77+
}
5378
}

0 commit comments

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