Skip to content

Commit 0222574

Browse files
committed
Support for PHP 8.3 and 8.4 only.
1 parent ea6910a commit 0222574

File tree

9 files changed

+51
-41
lines changed

9 files changed

+51
-41
lines changed

.github/workflows/unit.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
php-version:
19-
- "8.1"
20-
- "8.2"
2119
- "8.3"
20+
- "8.4"
2221

2322
steps:
2423
- name: "Checkout"

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
/.phpunit.result.cache
33
/bin/
44
/composer.lock
5-
/custom.task.properties
6-
/custom.type.properties
75
/test/coverage.xml
86
/test/report/
97
/vendor/

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
<exec executable="bin/phpunit" passthru="true" checkreturn="true"/>
3434
</target>
3535

36-
<target name="build"/>
36+
<target name="build" depends="update,unit"/>
3737
</project>

composer.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@
88
],
99
"license": "MIT",
1010
"require": {
11-
"php": ">=8.1",
11+
"php": ">=8.3",
1212
"ext-mbstring": "*",
1313
"plaisio/error-logger": "^1.3.0",
1414
"plaisio/helper-html": "^4.1.0",
15-
"plaisio/var-dumper": "^1.4.0",
16-
"plaisio/var-dumper-writer": "^3.0.0"
15+
"plaisio/var-dumper": "^1.54.0",
16+
"plaisio/var-dumper-writer": "^3.1.0"
1717
},
18-
"minimum-stability": "dev",
19-
"prefer-stable": true,
2018
"require-dev": {
2119
"ext-mysqli": "*",
22-
"phing/phing": "^3.0.0-RC4",
23-
"phpunit/phpunit": "^9.6.3"
20+
"phing/phing": "^3.0.1",
21+
"phpunit/phpunit": "^11.5.22"
2422
},
2523
"autoload": {
2624
"psr-4": {

phpunit.xml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="test/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">src</directory>
6-
</include>
7-
<exclude>
8-
<directory suffix=".php">vendor/setbased</directory>
9-
</exclude>
10-
<report>
11-
<clover outputFile="test/coverage.xml"/>
12-
<html outputDirectory="test/report"/>
13-
</report>
14-
</coverage>
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
displayDetailsOnTestsThatTriggerDeprecations="true"
5+
displayDetailsOnTestsThatTriggerErrors="true"
6+
displayDetailsOnTestsThatTriggerNotices="true"
7+
displayDetailsOnTestsThatTriggerWarnings="true"
8+
displayDetailsOnPhpunitDeprecations="true">
159
<testsuites>
16-
<testsuite name="Tests">
10+
<testsuite name="default">
1711
<directory>test</directory>
1812
</testsuite>
1913
</testsuites>
20-
<logging/>
14+
15+
<source ignoreIndirectDeprecations="true" restrictNotices="true" restrictWarnings="true">
16+
<include>
17+
<directory>src</directory>
18+
</include>
19+
</source>
2120
</phpunit>

src/CoreErrorLogger.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function logError(\Throwable $throwable): void
9595
$this->echoPageTrailer();
9696
$this->closeStream();
9797
}
98-
catch (\Throwable $throwable)
98+
catch (\Throwable)
9999
{
100100
// Nothing to do.
101101
}
@@ -119,7 +119,10 @@ abstract protected function closeStream(): void;
119119
protected function echoErrorLog(?\Throwable $throwable, bool $isPrevious = false): void
120120
{
121121
// Return immediately if there is not throwable.
122-
if ($throwable===null) return;
122+
if ($throwable===null)
123+
{
124+
return;
125+
}
123126

124127
if (!$isPrevious)
125128
{
@@ -422,7 +425,10 @@ private function echoTraceStack(\Throwable $throwable): void
422425
$trace = $throwable->getTrace();
423426

424427
// Return immediately if the trace is empty.
425-
if (empty($trace)) return;
428+
if (empty($trace))
429+
{
430+
return;
431+
}
426432

427433
fwrite($this->handle, '<div class="trace">');
428434
fwrite($this->handle, '<h2>Stack Trace</h2>');
@@ -443,7 +449,10 @@ private function echoTraceStack(\Throwable $throwable): void
443449
private function echoVarDump(): void
444450
{
445451
// Return immediately if there are no variables to dump.
446-
if ($this->dump===null) return;
452+
if ($this->dump===null)
453+
{
454+
return;
455+
}
447456

448457
fwrite($this->handle, Html::htmlNested(['tag' => 'h2',
449458
'text' => 'VarDump']));

src/DevelopmentErrorLogger.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ class DevelopmentErrorLogger extends CoreErrorLogger
1111
{
1212
//--------------------------------------------------------------------------------------------------------------------
1313
/**
14-
* Opens output.
14+
* {@inheritdoc}
1515
*/
16-
protected function openStream(): void
16+
protected function closeStream(): void
1717
{
18-
$this->handle = fopen('php://output', 'wb');
18+
fclose($this->handle);
1919
}
2020

2121
//--------------------------------------------------------------------------------------------------------------------
2222
/**
23-
* {@inheritdoc}
23+
* Opens output.
2424
*/
25-
protected function closeStream(): void
25+
protected function openStream(): void
2626
{
27-
fclose($this->handle);
27+
$this->handle = fopen('php://output', 'wb');
2828
}
2929

3030
//--------------------------------------------------------------------------------------------------------------------

src/HtmlVarWriter.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ private function writeName(mixed $name, ?int $id = null): void
250250
elseif (is_string($name))
251251
{
252252
$class = 'string';
253-
$text = mb_strimwidth((string)$name, 0, 20, '...');
253+
$text = mb_strimwidth($name, 0, 20, '...');
254254
if ($text!=$name)
255255
{
256-
$title = mb_strimwidth((string)$name, 0, 512, '...');
256+
$title = mb_strimwidth($name, 0, 512, '...');
257257
}
258258
}
259259
else
@@ -285,7 +285,12 @@ private function writeName(mixed $name, ?int $id = null): void
285285
* @param string $class The class of the value.
286286
* @param string|null $title The title for the value.
287287
*/
288-
private function writeScalar(?int $id, ?int $ref, mixed $name, string $text, string $class, ?string $title = null)
288+
private function writeScalar(?int $id,
289+
?int $ref,
290+
mixed $name,
291+
string $text,
292+
string $class,
293+
?string $title = null): void
289294
{
290295
$html = Html::htmlNested(['tag' => 'span',
291296
'attr' => ['class' => $class, 'title' => $title],

test/CoreErrorLoggerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public function setUp(): void
3333
{
3434
parent::setUp();
3535

36+
ini_set('zend.exception_ignore_args', false);
37+
3638
$this->errorLogger = new TestErrorLogger();
3739
}
3840

0 commit comments

Comments
 (0)