Skip to content

Commit a2c1f93

Browse files
authored
Merge pull request #341 from mimmi20/updates
upgrade to PHP 8.3
2 parents 56d5f07 + 8f6899c commit a2c1f93

File tree

11 files changed

+43
-64
lines changed

11 files changed

+43
-64
lines changed

.codeclimate.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
version: "2"
22
checks:
33
argument-count:
4-
enabled: true
4+
enabled: false
55
complex-logic:
6-
enabled: true
6+
enabled: false
77
file-lines:
88
enabled: false
99
method-complexity:
10-
enabled: true
10+
enabled: false
1111
method-count:
12-
enabled: true
12+
enabled: false
1313
method-lines:
14-
enabled: true
14+
enabled: false
1515
nested-control-flow:
1616
enabled: true
1717
return-statements:
18-
enabled: true
18+
enabled: false
1919
similar-code:
2020
enabled: false
2121
identical-code:

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
validate:
2020
name: "Validate Project"
2121

22-
uses: "mimmi20/ci/.github/workflows/validate.yml@8.1"
22+
uses: "mimmi20/ci/.github/workflows/validate.yml@8.3"
2323
with:
2424
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
2525
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
@@ -37,7 +37,7 @@ jobs:
3737

3838
needs: "validate"
3939

40-
uses: "mimmi20/ci/.github/workflows/install.yml@8.1"
40+
uses: "mimmi20/ci/.github/workflows/install.yml@8.3"
4141
with:
4242
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
4343
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
@@ -50,7 +50,7 @@ jobs:
5050

5151
needs: "install"
5252

53-
uses: "mimmi20/ci/.github/workflows/analytics.yml@8.1"
53+
uses: "mimmi20/ci/.github/workflows/analytics.yml@8.3"
5454
with:
5555
extensions: "ctype, curl, dom, iconv, intl, mbstring, simplexml, tokenizer, xml, xmlwriter"
5656
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"
@@ -59,7 +59,7 @@ jobs:
5959
skip-phpcs: false
6060
skip-phpstan: false
6161
skip-rector: false
62-
skip-phpmd: false
62+
skip-phpmd: true
6363
skip-eslint: true
6464
skip-stylelint: true
6565
skip-prettier: true
@@ -70,7 +70,7 @@ jobs:
7070

7171
needs: "analytics"
7272

73-
uses: "mimmi20/ci/.github/workflows/test.yml@8.1"
73+
uses: "mimmi20/ci/.github/workflows/test.yml@8.3"
7474
with:
7575
extensions: "ctype, dom, fileinfo, intl, simplexml, tokenizer, xml, xmlwriter"
7676
ini-values: "opcache.enable=1, opcache.fast_shutdown=0, zend.assertions=1, assert.exception=On, intl.default_locale=de, intl.use_exceptions=1, zend.exception_ignore_args=0"

.php-cs-fixer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111

1212
declare(strict_types = 1);
1313

14-
$header = <<<'EOF'
14+
$year = date('Y');
15+
16+
$header = <<<EOF
1517
This file is part of the mimmi20/mezzio-generic-authorization-rbac package.
1618
17-
Copyright (c) 2020-2024, Thomas Mueller <[email protected]>
19+
Copyright (c) 2020-{$year}, Thomas Mueller <[email protected]>
1820
1921
For the full copyright and license information, please view the LICENSE
2022
file that was distributed with this source code.

codecov.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@ codecov:
22
require_ci_to_pass: false
33
notify:
44
wait_for_ci: false
5+
6+
coverage:
57
status:
68
project:
7-
default:
9+
default: # default is the status check's name, not default settings
810
target: 100%
911
threshold: 1%
12+
if_ci_failed: success #success, failure, error, ignore
1013
informational: true
14+
only_pulls: false
1115
patch:
1216
default:
1317
informational: true

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"source": "https://github.com/mimmi20/mezzio-generic-authorization"
2424
},
2525
"require": {
26-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
26+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
2727
"mezzio/mezzio-authentication": "^1.10.0",
2828
"mezzio/mezzio-router": "^3.18.0",
2929
"psr/container": "^1.1.2 || ^2.0.2",
@@ -40,17 +40,17 @@
4040
"ext-xml": "*",
4141
"ext-xmlwriter": "*",
4242
"infection/infection": "^0.29.8",
43-
"laminas/laminas-servicemanager": "^4.3.0",
44-
"mimmi20/coding-standard": "^5.2.45",
43+
"laminas/laminas-servicemanager": "^3.23.0",
44+
"mimmi20/coding-standard": "^6.0.0",
4545
"nikic/php-parser": "^5.3.1",
4646
"phpstan/extension-installer": "^1.4.3",
4747
"phpstan/phpstan": "^1.12.9",
4848
"phpstan/phpstan-deprecation-rules": "^1.2.1",
4949
"phpstan/phpstan-phpunit": "^1.4.0",
50-
"phpunit/phpunit": "^10.5.26",
50+
"phpunit/phpunit": "^11.4.4",
5151
"rector/rector": "^1.2.10",
5252
"rector/type-perfect": "^1.0.0",
53-
"symfony/process": "^6.4.15",
53+
"symfony/process": "^7.2.0",
5454
"symplify/phpstan-rules": "^13.0.1",
5555
"tomasvotruba/cognitive-complexity": "^0.2.3",
5656
"tomasvotruba/type-coverage": "^1.0.0",

phpmd.ruleset.xml

Lines changed: 0 additions & 36 deletions
This file was deleted.

phpstan.neon

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
parameters:
22
level: max
33

4+
phpVersion: 80300 # PHP 8.3
5+
46
parallel:
57
maximumNumberOfProcesses: 1
68
processTimeout: 200.0
@@ -99,9 +101,10 @@ parameters:
99101
function: 16
100102

101103
type_coverage:
102-
return: 100
103-
param: 100
104-
property: 100
104+
return_type: 100
105+
param_type: 100
106+
property_type: 100
107+
constant_type: 100
105108
# also, how many files has declare strict types
106109
declare: 100
107110

phpunit.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
beStrictAboutCoverageMetadata="false"
1010
beStrictAboutOutputDuringTests="true"
1111
beStrictAboutTestsThatDoNotTestAnything="true"
12+
displayDetailsOnPhpunitDeprecations="true"
1213
displayDetailsOnTestsThatTriggerWarnings="true"
1314
displayDetailsOnTestsThatTriggerNotices="true"
1415
displayDetailsOnTestsThatTriggerErrors="true"
1516
displayDetailsOnTestsThatTriggerDeprecations="true"
1617
displayDetailsOnSkippedTests="true"
1718
displayDetailsOnIncompleteTests="true"
19+
failOnPhpunitDeprecation="true"
1820
failOnEmptyTestSuite="true"
1921
failOnIncomplete="true"
2022
failOnRisky="true"
@@ -51,7 +53,7 @@
5153
</testsuite>
5254
</testsuites>
5355

54-
<coverage includeUncoveredFiles="true">
56+
<coverage>
5557
<report>
5658
<clover outputFile=".reports/clover.xml"/>
5759
<html outputDirectory=".reports/report/" lowUpperBound="50" highLowerBound="80"/>

rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
$rectorConfig->sets([
3232
SetList::DEAD_CODE,
33-
LevelSetList::UP_TO_PHP_81,
33+
LevelSetList::UP_TO_PHP_83,
3434
PHPUnitSetList::PHPUNIT_100,
3535
]);
3636

src/AuthorizationMiddleware.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use InvalidArgumentException;
1717
use Mezzio\Authentication\UserInterface;
1818
use Mezzio\Router\RouteResult;
19+
use Override;
1920
use Psr\Http\Message\ResponseFactoryInterface;
2021
use Psr\Http\Message\ResponseInterface;
2122
use Psr\Http\Message\ServerRequestInterface;
@@ -25,18 +26,19 @@
2526
use function count;
2627
use function sprintf;
2728

28-
final class AuthorizationMiddleware implements MiddlewareInterface
29+
final readonly class AuthorizationMiddleware implements MiddlewareInterface
2930
{
3031
/** @throws void */
3132
public function __construct(
32-
private readonly AuthorizationInterface $authorization,
33-
private readonly ResponseFactoryInterface $responseFactory,
34-
private readonly string | null $defaultPrivilege,
33+
private AuthorizationInterface $authorization,
34+
private ResponseFactoryInterface $responseFactory,
35+
private string | null $defaultPrivilege,
3536
) {
3637
// nothing to do
3738
}
3839

3940
/** @throws Exception\RuntimeException */
41+
#[Override]
4042
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
4143
{
4244
$user = $request->getAttribute(UserInterface::class);

0 commit comments

Comments
 (0)