diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 327b0cb..bbaee02 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,13 +21,12 @@ jobs: fail-fast: false matrix: php-version: - - 8.2 - - 8.3 - 8.4 - 8.5 symfony-version: - 6.4.* - 7.4.* + - 8.0.* dependencies: [lowest, highest] name: 'PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + ${{ matrix.dependencies }} dependencies' diff --git a/composer.json b/composer.json index 3dc1f87..53641a5 100644 --- a/composer.json +++ b/composer.json @@ -14,45 +14,43 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "php": "~8.4.0 || ~8.5.0", "ext-dom": "*", "ext-json": "*", - "azjezz/psl": "^2.9.1 || ^3.0.0 || ^4.0.0", - "coduo/php-matcher": "^6.0.15", - "dama/doctrine-test-bundle": "^7.3.0 || ^8.0.1", - "doctrine/data-fixtures": "^1.7.0 || ^2.0.0", - "doctrine/dbal": "^3.9.0 || ^4.0.2", - "doctrine/doctrine-fixtures-bundle": "^3.7.1 || ^4.0.0", - "doctrine/orm": "^2.20.0 || ^3.2.0", - "phpunit/phpunit": "^10.5 || ^11.5 || ^12.0", - "symfony/browser-kit": "^6.4 || ^7.2", - "symfony/css-selector": "^6.4 || ^7.2", - "symfony/dependency-injection": "^6.4 || ^7.2", - "symfony/framework-bundle": "^6.4 || ^7.2", - "symfony/polyfill-php83": "^1.31" + "azjezz/psl": "^3.3.0 || ^4.0.0", + "coduo/php-matcher": "^6.0.18", + "dama/doctrine-test-bundle": "^8.4", + "doctrine/data-fixtures": "^2.1.0", + "doctrine/dbal": "^3.10.0 || ^4.2.0", + "doctrine/doctrine-fixtures-bundle": "^3.7.3 || ^4.3.1", + "doctrine/orm": "^2.20.9 || ^3.5.0", + "phpunit/phpunit": "^12.4", + "symfony/browser-kit": "^6.4 || ^7.4 || ^8.0", + "symfony/css-selector": "^6.4 || ^7.4 || ^8.0", + "symfony/dependency-injection": "^6.4 || ^7.4 || ^8.0", + "symfony/framework-bundle": "^6.4 || ^7.4 || ^8.0" }, "require-dev": { "ext-imagick": "*", "ext-intl": "*", - "doctrine/coding-standard": "^12.0.0", + "doctrine/coding-standard": "^14.0.0", "ergebnis/composer-normalize": "^2.48.2", "mikey179/vfsstream": "^1.6.12", - "moneyphp/money": "^4.7.1", - "nesbot/carbon": "^3.10.3", - "php-standard-library/phpstan-extension": "^2.0.1", + "moneyphp/money": "^4.8.0", + "nesbot/carbon": "^3.11.0", + "php-standard-library/phpstan-extension": "^2.0.2", "phpstan/phpstan": "<=2.1.12", "phpstan/phpstan-phpunit": "^2.0.6", "phpstan/phpstan-strict-rules": "^2.0.6", "phpstan/phpstan-symfony": "^2.0.4", "spatie/pdf-to-image": "^3.1.0", - "spatie/pdf-to-text": "^1.54.1", - "squizlabs/php_codesniffer": "^3.13.4", - "symfony/clock": "^6.4 || ^7.2", - "symfony/console": "^6.4 || ^7.2", - "symfony/form": "^6.4 || ^7.2", - "symfony/security-core": "^6.4 || ^7.2", - "symfony/validator": "^6.4 || ^7.2", - "twig/twig": "^3.21.1" + "spatie/pdf-to-text": "^1.54.0", + "symfony/clock": "^6.4 || ^7.4 || ^8.0", + "symfony/console": "^6.4 || ^7.4 || ^8.0", + "symfony/form": "^6.4 || ^7.4 || ^8.0", + "symfony/security-core": "^6.4 || ^7.4 || ^8.0", + "symfony/validator": "^6.4 || ^7.4 || ^8.0", + "twig/twig": "^3.22.2" }, "conflict": { "spatie/pdf-to-image": "<3.0.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7e53698..23df6c9 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -4,6 +4,7 @@ bootstrap="vendor/autoload.php" failOnWarning="false" failOnIncomplete="false" + displayDetailsOnPhpunitNotices="true" cacheResult="false" cacheDirectory=".phpunit.cache"> diff --git a/src/DependencyInjection/Speicher210FunctionalTestExtension.php b/src/DependencyInjection/Speicher210FunctionalTestExtension.php index b912923..ca19319 100644 --- a/src/DependencyInjection/Speicher210FunctionalTestExtension.php +++ b/src/DependencyInjection/Speicher210FunctionalTestExtension.php @@ -17,8 +17,8 @@ final class Speicher210FunctionalTestExtension extends ConfigurableExtension */ public function loadInternal(array $mergedConfig, ContainerBuilder $container): void { - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); - $loader->load('services.xml'); + $loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); + $loader->load('services.php'); $container ->getDefinition(TestStubCreateCommand::class) diff --git a/src/Resources/config/services.php b/src/Resources/config/services.php new file mode 100644 index 0000000..0ebb53a --- /dev/null +++ b/src/Resources/config/services.php @@ -0,0 +1,13 @@ +services(); + + $services->set(TestStubCreateCommand::class) + ->tag('console.command'); +}; diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml deleted file mode 100644 index fb9f174..0000000 --- a/src/Resources/config/services.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/src/SnapshotUpdater/Driver/Json.php b/src/SnapshotUpdater/Driver/Json.php index 7daefde..7e22ab3 100644 --- a/src/SnapshotUpdater/Driver/Json.php +++ b/src/SnapshotUpdater/Driver/Json.php @@ -28,7 +28,7 @@ final class Json implements Driver { - public const DEFAULT_MATCHER_PATTERNS = [ + public const array DEFAULT_MATCHER_PATTERNS = [ '@string@', '@integer@', '@number@', diff --git a/src/Test/Assert/Pdf/PdfToImageConfiguration.php b/src/Test/Assert/Pdf/PdfToImageConfiguration.php index e1b1590..31c0a74 100644 --- a/src/Test/Assert/Pdf/PdfToImageConfiguration.php +++ b/src/Test/Assert/Pdf/PdfToImageConfiguration.php @@ -6,20 +6,20 @@ use Spatie\PdfToImage\Enums\OutputFormat; -final class PdfToImageConfiguration +final readonly class PdfToImageConfiguration { - private const DEFAULT_OUTPUT_FORMAT = OutputFormat::Jpg; - private const DEFAULT_RESOLUTION = 144; - private const DEFAULT_COMPRESSION_QUALITY = 50; + private const OutputFormat DEFAULT_OUTPUT_FORMAT = OutputFormat::Jpg; + private const int DEFAULT_RESOLUTION = 144; + private const int DEFAULT_COMPRESSION_QUALITY = 50; /** * @param positive-int $resolution * @param int<1,100> $compressionQuality */ private function __construct( - public readonly OutputFormat $outputFormat, - public readonly int $resolution, - public readonly int $compressionQuality, + public OutputFormat $outputFormat, + public int $resolution, + public int $compressionQuality, ) { } diff --git a/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php b/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php index ed45b66..338f92a 100644 --- a/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php +++ b/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php @@ -13,8 +13,6 @@ use function method_exists; -use const PHP_VERSION_ID; - abstract class FunctionTestCase extends TestCase { /** @@ -28,7 +26,7 @@ protected function getEntityManager(): EntityManager $configuration->setProxyDir(__DIR__ . '/Fixtures/Proxies'); $configuration->setProxyNamespace(__NAMESPACE__ . '\Proxy'); $configuration->setAutoGenerateProxyClasses(true); - if (PHP_VERSION_ID >= 80400 && method_exists($configuration, 'enableNativeLazyObjects')) { + if (method_exists($configuration, 'enableNativeLazyObjects')) { $configuration->enableNativeLazyObjects(true); } diff --git a/src/Test/RestControllerWebTestCase.php b/src/Test/RestControllerWebTestCase.php index ea03c40..4b6a9a4 100644 --- a/src/Test/RestControllerWebTestCase.php +++ b/src/Test/RestControllerWebTestCase.php @@ -32,7 +32,7 @@ */ abstract class RestControllerWebTestCase extends WebTestCase { - public const AUTHENTICATION_NONE = null; + public const null AUTHENTICATION_NONE = null; /** * The authenticated user for the test. diff --git a/src/Test/Symfony/Form/FormTypeTestCase.php b/src/Test/Symfony/Form/FormTypeTestCase.php index a15eac5..c25ce61 100644 --- a/src/Test/Symfony/Form/FormTypeTestCase.php +++ b/src/Test/Symfony/Form/FormTypeTestCase.php @@ -108,7 +108,7 @@ protected function createFormType(mixed $initialData = null): FormInterface } /** - * @param array $submittedData + * @param array $submittedData */ protected function assertFormSubmitOnGet(array $submittedData, mixed $expected, mixed $initialData = null): void { @@ -117,8 +117,8 @@ protected function assertFormSubmitOnGet(array $submittedData, mixed $expected, } /** - * @param array $submittedData - * @param array $submittedFilesData + * @param array $submittedData + * @param array $submittedFilesData */ protected function assertFormSubmitOnPost(array $submittedData, mixed $expected, mixed $initialData = null, array $submittedFilesData = []): void { @@ -127,8 +127,8 @@ protected function assertFormSubmitOnPost(array $submittedData, mixed $expected, } /** - * @param array $submittedFilesData - * @param array $submittedData + * @param array $submittedData + * @param array $submittedFilesData */ protected function assertFormSubmitOnPatch(array $submittedData, mixed $initialData, mixed $expected, array $submittedFilesData = []): void { @@ -137,8 +137,8 @@ protected function assertFormSubmitOnPatch(array $submittedData, mixed $initialD } /** - * @param array $submittedData - * @param array $submittedFilesData + * @param array $submittedData + * @param array $submittedFilesData */ protected function assertFormSubmitOnPostWithInvalidData(array $submittedData, mixed $initialData = null, array $submittedFilesData = []): void { @@ -146,8 +146,8 @@ protected function assertFormSubmitOnPostWithInvalidData(array $submittedData, m } /** - * @param array $submittedData - * @param array $submittedFilesData + * @param array $submittedData + * @param array $submittedFilesData */ protected function assertFormSubmitOnPatchWithInvalidData(array $submittedData, mixed $initialData, array $submittedFilesData = []): void { @@ -155,7 +155,7 @@ protected function assertFormSubmitOnPatchWithInvalidData(array $submittedData, } /** - * @param array $submittedData + * @param array $submittedData */ protected function assertFormSubmitOnGetWithInvalidData(array $submittedData): void { @@ -163,9 +163,9 @@ protected function assertFormSubmitOnGetWithInvalidData(array $submittedData): v } /** - * @param array $submittedData - * @param Request::METHOD_* $method - * @param array $submittedFilesData + * @param array $submittedData + * @param Request::METHOD_* $method + * @param array $submittedFilesData */ private function assertFormSubmitWithInvalidData(array $submittedData, string $method, mixed $initialData = null, array $submittedFilesData = []): void { @@ -194,9 +194,9 @@ private function assertFormSubmitWithInvalidData(array $submittedData, string $m } /** - * @param array $submittedRequestData - * @param Request::METHOD_* $method - * @param array $submittedFilesData + * @param array $submittedRequestData + * @param Request::METHOD_* $method + * @param array $submittedFilesData * * @return FormInterface */ diff --git a/src/Test/WebTestCase.php b/src/Test/WebTestCase.php index 67b73c8..50282c8 100644 --- a/src/Test/WebTestCase.php +++ b/src/Test/WebTestCase.php @@ -35,12 +35,12 @@ abstract class WebTestCase extends KernelTestCase { - protected const IMAGE_TYPE_BMP = 'bmp'; - protected const IMAGE_TYPE_GIF = 'gif'; - protected const IMAGE_TYPE_JPG = 'jpg'; - protected const IMAGE_TYPE_PNG = 'png'; - protected const IMAGE_TYPE_SVG = 'svg'; - private const IMAGE_TYPES = [ + protected const string IMAGE_TYPE_BMP = 'bmp'; + protected const string IMAGE_TYPE_GIF = 'gif'; + protected const string IMAGE_TYPE_JPG = 'jpg'; + protected const string IMAGE_TYPE_PNG = 'png'; + protected const string IMAGE_TYPE_SVG = 'svg'; + private const array IMAGE_TYPES = [ self::IMAGE_TYPE_BMP, self::IMAGE_TYPE_GIF, self::IMAGE_TYPE_JPG, diff --git a/tests/Constraint/ResponseHeaderSameTest.php b/tests/Constraint/ResponseHeaderSameTest.php index 92998c9..c0effc2 100644 --- a/tests/Constraint/ResponseHeaderSameTest.php +++ b/tests/Constraint/ResponseHeaderSameTest.php @@ -14,9 +14,9 @@ final class ResponseHeaderSameTest extends TestCase { public function testEvaluateReturnsNullForTheSameHeader(): void { - $response = $this->createMock(Response::class); + $response = self::createStub(Response::class); $headerBagMock = $this->createMock(ResponseHeaderBag::class); - $headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value'); + $headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value'); $response->headers = $headerBagMock; $constraint = new ResponseHeaderSame('header-name', 'some_value'); @@ -26,9 +26,9 @@ public function testEvaluateReturnsNullForTheSameHeader(): void public function testEvaluateThrowsExceptionForDifferentHeader(): void { - $response = $this->createMock(Response::class); + $response = self::createStub(Response::class); $headerBagMock = $this->createMock(ResponseHeaderBag::class); - $headerBagMock->expects(self::exactly(2))->method('get')->with('header-name')->willReturn('some_value'); + $headerBagMock->expects($this->exactly(2))->method('get')->with('header-name')->willReturn('some_value'); $response->headers = $headerBagMock; $constraint = new ResponseHeaderSame('header-name', 'some_value1'); @@ -43,9 +43,9 @@ public function testEvaluateThrowsExceptionForDifferentHeader(): void public function testEvaluateReturnsTrueForTheSameHeaderWithReturnResultSetToTrue(): void { - $response = $this->createMock(Response::class); + $response = self::createStub(Response::class); $headerBagMock = $this->createMock(ResponseHeaderBag::class); - $headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value'); + $headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value'); $response->headers = $headerBagMock; $constraint = new ResponseHeaderSame('header-name', 'some_value'); @@ -55,9 +55,9 @@ public function testEvaluateReturnsTrueForTheSameHeaderWithReturnResultSetToTrue public function testEvaluateReturnsFalseForDifferentHeaderWithReturnResultSetToTrue(): void { - $response = $this->createMock(Response::class); + $response = self::createStub(Response::class); $headerBagMock = $this->createMock(ResponseHeaderBag::class); - $headerBagMock->expects(self::once())->method('get')->with('header-name')->willReturn('some_value'); + $headerBagMock->expects($this->once())->method('get')->with('header-name')->willReturn('some_value'); $response->headers = $headerBagMock; $constraint = new ResponseHeaderSame('header-name', 'some_value1');