Skip to content

Commit fb3df02

Browse files
authored
Merge pull request #258 from mimmi20/updates
upgrade to PHP 8.3
2 parents 9eb32a4 + df88843 commit fb3df02

File tree

10 files changed

+38
-15
lines changed

10 files changed

+38
-15
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 4 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"
@@ -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
@@ -12,10 +12,12 @@
1212

1313
declare(strict_types = 1);
1414

15-
$header = <<<'EOF'
15+
$year = date('Y');
16+
17+
$header = <<<EOF
1618
This file is part of the mimmi20/monolog-callbackfilterhandler package.
1719
18-
Copyright (c) 2022-2024, Thomas Mueller <mimmi20@live.de>
20+
Copyright (c) 2022-{$year}, Thomas Mueller <mimmi20@live.de>
1921
Copyright (c) 2015-2021, Laurent Laville <pear@laurent-laville.org>
2022
2123
For the full copyright and license information, please view the LICENSE

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"source": "https://github.com/mimmi20/monolog-callbackfilterhandler"
2121
},
2222
"require": {
23-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
23+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
2424
"ext-json": "*",
2525
"monolog/monolog": "^3.8.0"
2626
},
@@ -33,17 +33,17 @@
3333
"ext-xml": "*",
3434
"ext-xmlwriter": "*",
3535
"infection/infection": "^0.29.8",
36-
"mimmi20/coding-standard": "^5.2.45",
36+
"mimmi20/coding-standard": "^6.0.0",
3737
"nikic/php-parser": "^5.3.1",
3838
"phpstan/extension-installer": "^1.4.3",
3939
"phpstan/phpstan": "^1.12.9",
4040
"phpstan/phpstan-deprecation-rules": "^1.2.1",
4141
"phpstan/phpstan-phpunit": "^1.4.0",
42-
"phpunit/phpunit": "^10.5.25",
42+
"phpunit/phpunit": "^11.4.4",
4343
"psr/log": "^3.0.2",
4444
"rector/rector": "^1.2.10",
4545
"rector/type-perfect": "^1.0.0",
46-
"symfony/process": "^6.4.15",
46+
"symfony/process": "^7.2.0",
4747
"symplify/phpstan-rules": "^13.0.1",
4848
"tomasvotruba/cognitive-complexity": "^0.2.3",
4949
"tomasvotruba/type-coverage": "^1.0.0",

phpstan.neon

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

4-
phpVersion: 80100 # PHP 8.1
4+
phpVersion: 80300 # PHP 8.3
55

66
parallel:
77
maximumNumberOfProcesses: 1
@@ -104,7 +104,7 @@ parameters:
104104
return_type: 100
105105
param_type: 100
106106
property_type: 100
107-
constant_type: 0
107+
constant_type: 100
108108
# also, how many files has declare strict types
109109
declare: 100
110110

phpunit.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,18 @@
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"
21-
failOnSkipped="false"
23+
failOnSkipped="true"
2224
failOnDeprecation="true"
2325
failOnNotice="true"
2426
failOnWarning="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/CallbackFilterHandler.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use Monolog\Level;
2828
use Monolog\LogRecord;
2929
use Monolog\ResettableInterface;
30+
use Override;
3031
use Psr\Log\LogLevel;
3132
use RuntimeException;
3233

@@ -91,6 +92,7 @@ public function __construct(
9192
}
9293

9394
/** @throws void */
95+
#[Override]
9496
public function isHandling(LogRecord $record): bool
9597
{
9698
if (!parent::isHandling($record)) {
@@ -110,6 +112,7 @@ public function isHandling(LogRecord $record): bool
110112
}
111113

112114
/** @throws RuntimeException */
115+
#[Override]
113116
public function handle(LogRecord $record): bool
114117
{
115118
// The same logic as in FilterHandler
@@ -130,6 +133,7 @@ public function handle(LogRecord $record): bool
130133
*
131134
* @throws RuntimeException
132135
*/
136+
#[Override]
133137
public function handleBatch(array $records): void
134138
{
135139
// The same logic as in FilterHandler
@@ -175,6 +179,7 @@ public function getHandler(LogRecord | null $record = null): HandlerInterface
175179
}
176180

177181
/** @throws RuntimeException */
182+
#[Override]
178183
public function reset(): void
179184
{
180185
$this->resetProcessors();

tests/AbstractTestHandler.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use Monolog\Handler\Handler;
1818
use Monolog\LogRecord;
19+
use Override;
1920

2021
/**
2122
* Features included in dev-master branch but not yet released as a stable version
@@ -33,6 +34,7 @@ abstract class AbstractTestHandler extends Handler
3334
*
3435
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
3536
*/
37+
#[Override]
3638
public function isHandling(LogRecord $record): bool
3739
{
3840
return false;
@@ -43,6 +45,7 @@ public function isHandling(LogRecord $record): bool
4345
*
4446
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
4547
*/
48+
#[Override]
4649
public function handle(LogRecord $record): bool
4750
{
4851
return false;

tests/CallbackFilterHandlerTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
use Monolog\LogRecord;
2323
use Monolog\Processor\ProcessorInterface;
2424
use Monolog\Processor\UidProcessor;
25+
use Override;
2526
use PHPUnit\Framework\Attributes\DataProvider;
2627
use PHPUnit\Framework\Exception;
2728
use Psr\Log\InvalidArgumentException;
@@ -452,6 +453,7 @@ public function testHandleWithBadFilterThrowsException(): void
452453
*
453454
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
454455
*/
456+
#[Override]
455457
public function isHandling(LogRecord $record): bool
456458
{
457459
throw new \Exception();
@@ -462,6 +464,7 @@ public function isHandling(LogRecord $record): bool
462464
*
463465
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
464466
*/
467+
#[Override]
465468
public function handle(LogRecord $record): bool
466469
{
467470
throw new \Exception();
@@ -474,12 +477,14 @@ public function handle(LogRecord $record): bool
474477
*
475478
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
476479
*/
480+
#[Override]
477481
public function handleBatch(array $records): void
478482
{
479483
throw new \Exception();
480484
}
481485

482486
/** @throws \Exception */
487+
#[Override]
483488
public function close(): void
484489
{
485490
throw new \Exception();
@@ -508,6 +513,7 @@ public function testGetHandler(): void
508513
*
509514
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
510515
*/
516+
#[Override]
511517
public function isHandling(LogRecord $record): bool
512518
{
513519
throw new \Exception();
@@ -518,6 +524,7 @@ public function isHandling(LogRecord $record): bool
518524
*
519525
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
520526
*/
527+
#[Override]
521528
public function handle(LogRecord $record): bool
522529
{
523530
throw new \Exception();
@@ -530,12 +537,14 @@ public function handle(LogRecord $record): bool
530537
*
531538
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
532539
*/
540+
#[Override]
533541
public function handleBatch(array $records): void
534542
{
535543
throw new \Exception();
536544
}
537545

538546
/** @throws \Exception */
547+
#[Override]
539548
public function close(): void
540549
{
541550
throw new \Exception();

tests/TestHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
use Monolog\Handler\TestHandler as BaseTestHandler;
1818
use Monolog\Level;
19+
use Override;
1920

2021
use function array_keys;
2122
use function count;
@@ -82,6 +83,7 @@ public function hasDebugThatContains(string $message): bool
8283
}
8384

8485
/** @throws void */
86+
#[Override]
8587
public function hasRecordThatContains(string $message, Level $level): bool
8688
{
8789
if (!isset($this->recordsByLevel[$level->value])) {

0 commit comments

Comments
 (0)