Skip to content

Commit 3dc8742

Browse files
feature(php-cop#82|php-cop#83|#64): Ready Fusonic PHP extensions for Symfony 7.1
1 parent a79ea70 commit 3dc8742

File tree

7 files changed

+56
-39
lines changed

7 files changed

+56
-39
lines changed

Diff for: .gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@
99
composer.lock
1010

1111
###> friendsofphp/php-cs-fixer ###
12-
/.php-cs-fixer.php
1312
/.php-cs-fixer.cache
1413
###< friendsofphp/php-cs-fixer ###
1514

1615
###> phpunit/phpunit ###
1716
/phpunit.xml
18-
.phpunit.result.cache
17+
/.phpunit.cache
1918
###< phpunit/phpunit ###

Diff for: .php-cs-fixer.dist.php renamed to .php-cs-fixer.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<?php
22

3+
/*
4+
* Copyright (c) Fusonic GmbH. All rights reserved.
5+
* Licensed under the MIT License. See LICENSE file in the project root for license information.
6+
*/
7+
38
declare(strict_types=1);
49

5-
$finder = PhpCsFixer\Finder::create()
10+
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;
11+
12+
$finder = (new PhpCsFixer\Finder())
613
->in(__DIR__);
714

815
return (new PhpCsFixer\Config())
16+
->setParallelConfig(ParallelConfigFactory::detect())
917
->setRules([
1018
'@PHP82Migration' => true,
1119
'@Symfony' => true,
@@ -18,7 +26,6 @@
1826
],
1927
'no_useless_else' => true,
2028
'no_useless_return' => true,
21-
'nullable_type_declaration_for_default_null_value' => true,
2229
'php_unit_strict' => true,
2330
'single_line_throw' => false,
2431
'strict_comparison' => true,

Diff for: composer.json

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "fusonic/http-kernel-bundle",
33
"description": "Symfony bundle with extensions for Symfony's HttpKernel",
4-
"version": "1.3.2",
4+
"version": "1.3.3",
55
"type": "library",
66
"license": "MIT",
77
"authors": [
@@ -33,21 +33,22 @@
3333
"symfony/validator": "^6.3 || ^7.0"
3434
},
3535
"require-dev": {
36-
"friendsofphp/php-cs-fixer": "^3.40",
37-
"infection/infection": "^0.27",
38-
"phpstan/phpstan": "^1.10",
39-
"phpstan/phpstan-phpunit": "^1.3",
40-
"phpstan/phpstan-strict-rules": "^1.5",
41-
"phpstan/phpstan-symfony": "^1.3",
42-
"phpunit/phpunit": "^10.5",
36+
"friendsofphp/php-cs-fixer": "^3.58",
37+
"infection/infection": "^0.29",
38+
"phpstan/phpstan": "^1.11",
39+
"phpstan/phpstan-deprecation-rules": "^1.2",
40+
"phpstan/phpstan-phpunit": "^1.4",
41+
"phpstan/phpstan-strict-rules": "^1.6",
42+
"phpstan/phpstan-symfony": "^1.4",
43+
"phpunit/phpunit": "^11.2",
4344
"roave/security-advisories": "dev-latest",
4445
"symfony/cache": "^6.3 || ^7.0",
45-
"tomasvotruba/type-coverage": "^0.2"
46+
"tomasvotruba/type-coverage": "^0.3"
4647
},
4748
"scripts": {
4849
"phpstan": "XDEBUG_MODE=off php -d memory_limit=2048M vendor/bin/phpstan analyse",
49-
"phpcs-check": "XDEBUG_MODE=off vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v --diff --dry-run",
50-
"phpcs-fix": "XDEBUG_MODE=off vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php -v",
50+
"phpcs-check": "XDEBUG_MODE=off vendor/bin/php-cs-fixer check -v --diff",
51+
"phpcs-fix": "XDEBUG_MODE=off vendor/bin/php-cs-fixer fix -v",
5152
"infection": "XDEBUG_MODE=coverage vendor/bin/infection",
5253
"test": "XDEBUG_MODE=off vendor/bin/phpunit --testdox",
5354
"test-coverage" : "XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-cobertura=coverage/phpunit/cobertura.xml --coverage-html=coverage/phpunit/html"

Diff for: phpstan.neon

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ parameters:
33
paths:
44
- src
55
- tests
6-
6+
scanFiles:
7+
- vendor/symfony/dependency-injection/Loader/Configurator/ContainerConfigurator.php
78
type_coverage:
8-
return_type: 100
9-
param_type: 100
10-
property_type: 100
11-
print_suggestions: false
9+
return: 100
10+
param: 100
11+
property: 100
1212

1313
includes:
14+
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
1415
- vendor/phpstan/phpstan-phpunit/extension.neon
16+
- vendor/phpstan/phpstan-phpunit/rules.neon
17+
- vendor/phpstan/phpstan-strict-rules/rules.neon
1518
- vendor/phpstan/phpstan-symfony/extension.neon
1619
- vendor/phpstan/phpstan-symfony/rules.neon
17-
- vendor/phpstan/phpstan-strict-rules/rules.neon
1820
- vendor/tomasvotruba/type-coverage/config/extension.neon
19-

Diff for: phpunit.xml.dist

+23-14
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,50 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<!-- https://phpunit.readthedocs.io/en/latest/configuration.html -->
42
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
6-
colors="true"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
74
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
colors="true"
8+
beStrictAboutCoverageMetadata="true"
9+
beStrictAboutOutputDuringTests="true"
810
displayDetailsOnTestsThatTriggerDeprecations="true"
11+
displayDetailsOnTestsThatTriggerNotices="true"
912
displayDetailsOnTestsThatTriggerWarnings="true"
1013
displayDetailsOnTestsThatTriggerErrors="true"
11-
failOnWarning="true"
1214
failOnRisky="true"
13-
>
14-
15+
failOnNotice="true"
16+
failOnWarning="true">
1517
<php>
1618
<ini name="display_errors" value="1"/>
1719
<ini name="error_reporting" value="-1"/>
20+
<ini name="memory_limit" value="512M"/>
21+
<server name="APP_ENV" value="test" force="true"/>
22+
<server name="APP_DEBUG" value="0" force="true"/>
1823
<server name="SHELL_VERBOSITY" value="-1"/>
19-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
20-
<env name="APP_DEBUG" value="false" />
2124
</php>
2225

2326
<testsuites>
2427
<testsuite name="Fusonic HttpKernel Bundle Test Suite">
25-
<directory>tests</directory>
28+
<directory>./tests/</directory>
2629
</testsuite>
2730
</testsuites>
2831

29-
<source ignoreSuppressionOfDeprecations="true"
32+
<source ignoreIndirectDeprecations="true"
33+
ignoreSuppressionOfDeprecations="true"
3034
ignoreSuppressionOfPhpDeprecations="true"
31-
ignoreSuppressionOfErrors="true"
35+
restrictNotices="true"
3236
ignoreSuppressionOfNotices="true"
3337
ignoreSuppressionOfPhpNotices="true"
38+
restrictWarnings="true"
3439
ignoreSuppressionOfWarnings="true"
35-
ignoreSuppressionOfPhpWarnings="true">
40+
ignoreSuppressionOfPhpWarnings="true"
41+
ignoreSuppressionOfErrors="true">
3642
<include>
3743
<directory>src</directory>
3844
</include>
39-
</source>
4045

46+
<deprecationTrigger>
47+
<function>trigger_deprecation</function>
48+
</deprecationTrigger>
49+
</source>
4150
</phpunit>

Diff for: src/Controller/RequestDtoResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(
4343
/**
4444
* @var iterable<ContextAwareProviderInterface>
4545
*/
46-
#[TaggedIterator(tag: ContextAwareProviderInterface::TAG_CONTEXT_AWARE_PROVIDER)]
46+
#[TaggedIterator(tag: ContextAwareProviderInterface::TAG_CONTEXT_AWARE_PROVIDER)] // @phpstan-ignore attribute.deprecated
4747
private readonly iterable $providers = [],
4848
?RequestDataCollectorInterface $modelDataParser = null,
4949
) {

Diff for: tests/Controller/RequestDtoResolverTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
use Fusonic\HttpKernelBundle\Tests\Dto\RouteParameterDto;
3232
use Fusonic\HttpKernelBundle\Tests\Dto\StringIdDto;
3333
use Fusonic\HttpKernelBundle\Tests\Dto\TestDto;
34+
use PHPUnit\Framework\Attributes\DataProvider;
3435
use PHPUnit\Framework\TestCase;
3536
use Symfony\Component\HttpFoundation\Request;
3637
use Symfony\Component\HttpKernel\ControllerMetadata\ArgumentMetadata;
@@ -516,9 +517,8 @@ public function testContextAwareProviderCalling(): void
516517
* @param array<mixed> $data
517518
* @param class-string $dtoClass
518519
* @param class-string $expectedViolationClass
519-
*
520-
* @dataProvider errorTestData
521520
*/
521+
#[DataProvider('errorTestData')]
522522
public function testConstraintViolationErrors(array $data, string $dtoClass, string $expectedViolationClass): void
523523
{
524524
/** @var string $data */

0 commit comments

Comments
 (0)