diff --git a/.php_cs.dist b/.php_cs.dist index ac3e985281..b28505eb45 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -8,8 +8,9 @@ return PhpCsFixer\Config::create() ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, - '@PHPUnit48Migration:risky' => true, - 'php_unit_no_expectation_annotation' => false, // part of `PHPUnitXYMigration:risky` ruleset, to be enabled when PHPUnit 4.x support will be dropped, as we don't want to rewrite exceptions handling twice + '@PHPUnit75Migration:risky' => true, + 'php_unit_dedicate_assert' => ['target' => '3.5'], + 'phpdoc_no_empty_return' => false, // triggers almost always false positive 'array_syntax' => ['syntax' => 'short'], 'fopen_flags' => false, 'ordered_imports' => true, diff --git a/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php b/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php index 591f58a62f..8c8bc56be5 100644 --- a/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php +++ b/src/Symfony/Component/Console/Tests/Logger/ConsoleLoggerTest.php @@ -165,7 +165,7 @@ class ConsoleLoggerTest extends TestCase if (method_exists($this, 'createPartialMock')) { $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']); } else { - $dummy = $this->getMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']); + $dummy = $this->createPartialMock('Symfony\Component\Console\Tests\Logger\DummyTest', ['__toString']); } $dummy->method('__toString')->willReturn('DUMMY'); diff --git a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php index f18809a5a2..aa7ae56b52 100644 --- a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php +++ b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\Debug\Tests\Exception; use PHPUnit\Framework\TestCase; +use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; use Symfony\Component\Debug\Exception\FatalThrowableError; use Symfony\Component\Debug\Exception\FlattenException; use Symfony\Component\HttpFoundation\Exception\SuspiciousOperationException; @@ -35,6 +36,8 @@ use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException; */ class FlattenExceptionTest extends TestCase { + use ForwardCompatTestTrait; + public function testStatusCode() { $flattened = FlattenException::create(new \RuntimeException(), 403); @@ -297,7 +300,7 @@ class FlattenExceptionTest extends TestCase // assertEquals() does not like NAN values. $this->assertEquals($array[$i][0], 'float'); - $this->assertTrue(is_nan($array[$i++][1])); + $this->assertNan($array[$i++][1]); } public function testRecursionInArguments() diff --git a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php index d607285196..3738d98a38 100644 --- a/src/Symfony/Component/DependencyInjection/ContainerBuilder.php +++ b/src/Symfony/Component/DependencyInjection/ContainerBuilder.php @@ -912,8 +912,8 @@ class ContainerBuilder extends Container implements TaggedContainerInterface * This methods allows for simple registration of service definition * with a fluid interface. * - * @param string $id The service identifier - * @param string $class|null The service class + * @param string $id The service identifier + * @param string|null $class The service class * * @return Definition A Definition instance */ diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php index 0e3142a2de..395f53ede1 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php @@ -571,7 +571,7 @@ class YamlFileLoader extends FileLoader /** * Parses a callable. * - * @param string|array $callable A callable reference + * @param string|array $callable A callable reference * * @throws InvalidArgumentException When errors occur * diff --git a/src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php b/src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php index 4b089936e7..6f627fec3a 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php @@ -55,15 +55,15 @@ class ContainerParametersResourceCheckerTest extends TestCase public function isFreshProvider() { - yield 'not fresh on missing parameter' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { + yield 'not fresh on missing parameter' => [function (\PHPUnit\Framework\MockObject\MockObject $container) { $container->method('hasParameter')->with('locales')->willReturn(false); }, false]; - yield 'not fresh on different value' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { + yield 'not fresh on different value' => [function (\PHPUnit\Framework\MockObject\MockObject $container) { $container->method('getParameter')->with('locales')->willReturn(['nl', 'es']); }, false]; - yield 'fresh on every identical parameters' => [function (\PHPUnit_Framework_MockObject_MockObject $container) { + yield 'fresh on every identical parameters' => [function (\PHPUnit\Framework\MockObject\MockObject $container) { $container->expects($this->exactly(2))->method('hasParameter')->willReturn(true); $container->expects($this->exactly(2))->method('getParameter') ->withConsecutive( diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php index ee449bad47..1bdafdc373 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\DependencyInjection\Tests; use PHPUnit\Framework\TestCase; use Symfony\Bridge\PhpUnit\ForwardCompatTestTrait; -use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 65835539bb..cad17cbc96 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -29,7 +29,6 @@ use Symfony\Component\DependencyInjection\EnvVarProcessorInterface; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; diff --git a/src/Symfony/Component/ErrorRenderer/Resources/assets/images/symfony-ghost.svg.php b/src/Symfony/Component/ErrorRenderer/Resources/assets/images/symfony-ghost.svg.php index 1a245e3f98..4b2f9c1b9b 100644 --- a/src/Symfony/Component/ErrorRenderer/Resources/assets/images/symfony-ghost.svg.php +++ b/src/Symfony/Component/ErrorRenderer/Resources/assets/images/symfony-ghost.svg.php @@ -1 +1 @@ - + diff --git a/src/Symfony/Component/ErrorRenderer/Resources/views/error.html.php b/src/Symfony/Component/ErrorRenderer/Resources/views/error.html.php index 8981b17399..5416d03c8c 100644 --- a/src/Symfony/Component/ErrorRenderer/Resources/views/error.html.php +++ b/src/Symfony/Component/ErrorRenderer/Resources/views/error.html.php @@ -1,15 +1,15 @@
- + -Something is broken. Please let us know what you were doing when this error occurred. diff --git a/src/Symfony/Component/ErrorRenderer/Resources/views/exception.html.php b/src/Symfony/Component/ErrorRenderer/Resources/views/exception.html.php index 1dd6bd2b9c..b470b5622b 100644 --- a/src/Symfony/Component/ErrorRenderer/Resources/views/exception.html.php +++ b/src/Symfony/Component/ErrorRenderer/Resources/views/exception.html.php @@ -1,25 +1,25 @@ -