Skip to content

Commit 4de38fb

Browse files
authored
Support PHP 8.3 (#24)
1 parent f7c9b0d commit 4de38fb

File tree

9 files changed

+62
-24
lines changed

9 files changed

+62
-24
lines changed

.circleci/config.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
tag: << parameters.version >>
144144
parameters:
145145
version:
146-
default: "7.4"
146+
default: "8.3"
147147
description: The `cimg/php` Docker image version tag.
148148
type: string
149149
install-flags:
@@ -154,7 +154,7 @@ jobs:
154154
- when:
155155
condition:
156156
and:
157-
- equal: [ "8.1", <<parameters.version>> ]
157+
- equal: [ "8.3", <<parameters.version>> ]
158158
- equal: [ "", <<parameters.install-flags>> ]
159159
steps:
160160
- run-phpunit-tests:
@@ -164,7 +164,7 @@ jobs:
164164
condition:
165165
not:
166166
and:
167-
- equal: [ "8.1", <<parameters.version>> ]
167+
- equal: [ "8.3", <<parameters.version>> ]
168168
- equal: [ "", <<parameters.install-flags>> ]
169169
steps:
170170
- run-phpunit-tests:
@@ -176,5 +176,5 @@ workflows:
176176
- matrix-conditions:
177177
matrix:
178178
parameters:
179-
version: ["7.4", "8.0", "8.1", "8.2"]
179+
version: ["7.4", "8.0", "8.1", "8.2", "8.3"]
180180
install-flags: ["", "--prefer-lowest"]

.editorconfig

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the top-most .editorconfig file; do not search in parent directories.
2+
root = true
3+
4+
# All files.
5+
[*]
6+
end_of_line = LF
7+
indent_style = space
8+
indent_size = 4
9+
charset = utf-8
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true
12+
13+
[composer.{json,lock}]
14+
indent_size = 4

.gitattributes

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Exclude build/test files from archive
2+
/.circleci export-ignore
3+
/test export-ignore
4+
/.editorconfig export-ignore
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/docs export-ignore
8+
/Doxyfile export-ignore
9+
/doxygen.tag.xml export-ignore
10+
/DoxygenLayout.xml export-ignore
11+
/phpcs.xml export-ignore
12+
/phpunit.xml export-ignore
13+
/rector.php export-ignore
14+
15+
# Configure diff output for .php and .phar files.
16+
*.php diff=php

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
/vendor/
2-
.*
2+
.DS_Store
3+
.ddev
4+
.idea
5+
.phpunit.result.cache
36
composer.lock
47
html
58
!.circleci

composer.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@
1010
}
1111
],
1212
"require": {
13-
"php": ">7.3 <8.3",
13+
"php": ">7.3 <8.4",
1414
"ext-json": "*",
15-
"getdkan/contracts": "^1.0.0"
15+
"getdkan/contracts": "^1.1.3"
1616
},
1717
"require-dev": {
1818
"phpunit/phpunit": ">8.5.14 <10.0.0",
19-
"rector/rector": "^0.15.17",
20-
"squizlabs/php_codesniffer": "^3.7"
19+
"rector/rector": "@stable",
20+
"squizlabs/php_codesniffer": "^3.7",
21+
"symfony/phpunit-bridge": "^7.0"
2122
},
2223
"autoload": {
2324
"psr-4": {

phpunit.xml

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
<?xml version="1.0"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" verbose="false">
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
4+
colors="true">
45
<coverage processUncoveredFiles="true">
56
<include>
6-
<directory suffix=".php">src</directory>
7+
<directory>src</directory>
78
</include>
89
</coverage>
10+
<listeners>
11+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
12+
</listeners>
13+
<php>
14+
<!-- Don't fail for external dependencies. -->
15+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[self]=0"/>
16+
</php>
917
<testsuites>
1018
<testsuite name="all">
1119
<directory>test</directory>

rector.php

+1-11
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,15 @@
88
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessParamTagRector;
99
use Rector\DeadCode\Rector\ClassMethod\RemoveUselessReturnTagRector;
1010
use Rector\DeadCode\Rector\Property\RemoveUselessVarTagRector;
11-
use Rector\Core\ValueObject\PhpVersion;
12-
use Rector\Set\ValueObject\LevelSetList;
1311

1412
return static function (RectorConfig $rectorConfig): void {
1513
$rectorConfig->paths([
1614
__DIR__ . '/src',
1715
__DIR__ . '/test',
1816
]);
1917

20-
// Our base version of PHP.
21-
$rectorConfig->phpVersion(PhpVersion::PHP_74);
22-
2318
$rectorConfig->sets([
24-
// Interestingly, LevelSetList::UP_TO_PHP_82 does not preserve PHP 7.4,
25-
// so we have to specify all the PHP versions leading up to it if we
26-
// want to keep 7.4 idioms.
2719
SetList::PHP_74,
28-
SetList::PHP_80,
29-
SetList::PHP_81,
30-
SetList::PHP_82,
3120
// Please no dead code or unneeded variables.
3221
SetList::DEAD_CODE,
3322
// Try to figure out type hints.
@@ -44,6 +33,7 @@
4433
RemoveUselessVarTagRector::class,
4534
]);
4635

36+
$rectorConfig->removeUnusedImports();
4737
$rectorConfig->importNames();
4838
$rectorConfig->importShortClasses(false);
4939
};

src/Job/Job.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function run(): Result
5555
return $this->result;
5656
}
5757

58-
private function processDataFromRunIt($data)
58+
private function processDataFromRunIt($data): void
5959
{
6060
if ($data instanceof Result) {
6161
$this->result = $data;
@@ -114,6 +114,9 @@ public function getResult(): Result
114114
return $this->result;
115115
}
116116

117+
/**
118+
* @return mixed
119+
*/
117120
#[\ReturnTypeWillChange]
118121
public function jsonSerialize()
119122
{

src/Result.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Result implements HydratableInterface
1818
private string $data = "";
1919
private string $error = "";
2020

21-
public function setStatus($status)
21+
public function setStatus($status): void
2222
{
2323
$statuss = [self::WAITING, self::STOPPED, self::IN_PROGRESS, self::ERROR, self::DONE];
2424
if (in_array($status, $statuss)) {
@@ -53,6 +53,9 @@ public function getError(): string
5353
return $this->error;
5454
}
5555

56+
/**
57+
* @return mixed
58+
*/
5659
#[\ReturnTypeWillChange]
5760
public function jsonSerialize()
5861
{

0 commit comments

Comments
 (0)