Skip to content

Commit 62bcc37

Browse files
Bump min php version to php 7.4 (#448)
* bump min php version to php 7.4 * bump ubuntu min verions; adds php 8.2 and 8.3 on smoke test phar step * bump box version * specify php version for scrutinizer using a config file
1 parent e162c85 commit 62bcc37

File tree

9 files changed

+33
-32
lines changed

9 files changed

+33
-32
lines changed

.github/workflows/build.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
16+
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
1717
coverage-driver: [ 'pcov' ]
1818

1919
steps:
@@ -52,7 +52,7 @@ jobs:
5252
run: ./bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml
5353

5454
- name: Upload coverage to Codecov
55-
if: ${{ matrix.php-versions == '7.2' }}
55+
if: ${{ matrix.php-versions == '7.4' }}
5656
uses: codecov/codecov-action@v1
5757
with:
5858
token: ${{ secrets.CODECOV_TOKEN }}
@@ -66,7 +66,7 @@ jobs:
6666
- name: Install PHP
6767
uses: shivammathur/setup-php@v2
6868
with:
69-
php-version: 7.2
69+
php-version: 7.4
7070
tools: composer:v2.2
7171
env:
7272
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
@@ -92,11 +92,10 @@ jobs:
9292

9393
smoke-test-phar:
9494
needs: phar
95-
runs-on: "ubuntu-20.04"
95+
runs-on: "ubuntu-22.04"
9696
strategy:
9797
matrix:
98-
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
99-
coverage-driver: [ 'pcov' ]
98+
php-versions: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
10099

101100
steps:
102101
- name: Install PHP
@@ -117,7 +116,7 @@ jobs:
117116

118117
publish_phar:
119118
needs: [build, smoke-test-phar]
120-
runs-on: "ubuntu-20.04"
119+
runs-on: "ubuntu-22.04"
121120
if: github.event_name == 'release'
122121
steps:
123122
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
@@ -136,7 +135,7 @@ jobs:
136135

137136
publish_docker_images:
138137
needs: [build, smoke-test-phar]
139-
runs-on: "ubuntu-20.04"
138+
runs-on: "ubuntu-22.04"
140139

141140
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
142141
steps:

.scrutinizer.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build:
2+
environment:
3+
php: 7.4
4+

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=7.2
1+
ARG PHP_VERSION=7.4
22

33
FROM php:${PHP_VERSION}-cli-alpine AS php_build
44

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ You can add parameters when you launch the tool. At the moment you can add these
464464
phparkitect check --config=/project/yourConfigFile.php
465465
```
466466
* `--target-php-version`: With this parameter, you can specify which PHP version should use the parser. This can be useful to debug problems and to understand if there are problems with a different PHP version.
467-
Supported PHP versions are: 7.2, 7.3, 7.4, 8.0, 8.1, 8.2
467+
Supported PHP versions are: 7.4, 8.0, 8.1, 8.2 8.3
468468
* `--stop-on-failure`: With this option the process will end immediately after the first violation.
469469

470470
## Run only a specific rule

bin/box.phar

315 KB
Binary file not shown.

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^7.2|^8",
26+
"php": "^7.4|^8",
2727
"symfony/finder": "^3.0|^4.0|^5.0|^6.0|^7.0",
2828
"symfony/event-dispatcher": "^3.0|^4.0|^5.0|^6.0|^7.0",
2929
"symfony/console": "^3.0|^4.0|^5.0|^6.0|^7.0",

src/CLI/TargetPhpVersion.php

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
class TargetPhpVersion
1010
{
1111
public const VALID_PHP_VERSIONS = [
12-
'7.2',
13-
'7.3',
1412
'7.4',
1513
'8.0',
1614
'8.1',

tests/Unit/Analyzer/FileVisitorTest.php

+17-17
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Cat implements AnInterface
4040
EOF;
4141

4242
/** @var FileParser $fp */
43-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
43+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
4444
$fp->parse($code, 'relativePathName');
4545
$cd = $fp->getClassDescriptions();
4646

@@ -85,7 +85,7 @@ class Cat implements AnInterface
8585
EOF;
8686

8787
/** @var FileParser $fp */
88-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
88+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
8989
$fp->parse($code, 'relativePathName');
9090
$cd = $fp->getClassDescriptions();
9191

@@ -121,7 +121,7 @@ class Cat extends Animal
121121
EOF;
122122

123123
/** @var FileParser $fp */
124-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
124+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
125125
$fp->parse($code, 'relativePathName');
126126

127127
$cd = $fp->getClassDescriptions()[1];
@@ -150,7 +150,7 @@ public function methodWithAnonymous(): void
150150
EOF;
151151

152152
/** @var FileParser $fp */
153-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
153+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
154154
$fp->parse($code, 'relativePathName');
155155

156156
$cd = $fp->getClassDescriptions()[1];
@@ -178,7 +178,7 @@ public function __construct(Request $request)
178178
EOF;
179179

180180
/** @var FileParser $fp */
181-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
181+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
182182
$fp->parse($code, 'relativePathName');
183183
$cd = $fp->getClassDescriptions();
184184

@@ -213,7 +213,7 @@ public function __construct(Request $request, ?Nullable $nullable)
213213
EOF;
214214

215215
/** @var FileParser $fp */
216-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
216+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
217217
$fp->parse($code, 'relativePathName');
218218
$cd = $fp->getClassDescriptions();
219219

@@ -848,7 +848,7 @@ public function getRequest(): Request //the violations is reported here
848848
EOF;
849849

850850
/** @var FileParser $fp */
851-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
851+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
852852
$fp->parse($code, 'relativePathName');
853853
$cd = $fp->getClassDescriptions();
854854

@@ -936,7 +936,7 @@ class MyClass
936936
EOF;
937937

938938
/** @noinspection PhpUnhandledExceptionInspection */
939-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
939+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
940940
$fp->parse($code, 'relativePathName');
941941
$cd = $fp->getClassDescriptions();
942942

@@ -966,7 +966,7 @@ class MyClass
966966
EOF;
967967

968968
/** @noinspection PhpUnhandledExceptionInspection */
969-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
969+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
970970
$fp->parse($code, 'relativePathName');
971971
$cd = $fp->getClassDescriptions();
972972

@@ -996,7 +996,7 @@ class MyClass
996996
EOF;
997997

998998
/** @noinspection PhpUnhandledExceptionInspection */
999-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
999+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
10001000
$fp->parse($code, 'relativePathName');
10011001
$cd = $fp->getClassDescriptions();
10021002

@@ -1028,7 +1028,7 @@ public function __construct(array $dtoList)
10281028
EOF;
10291029

10301030
/** @noinspection PhpUnhandledExceptionInspection */
1031-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1031+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
10321032
$fp->parse($code, 'relativePathName');
10331033
$cd = $fp->getClassDescriptions();
10341034

@@ -1060,7 +1060,7 @@ public function __construct(array $dtoList)
10601060
EOF;
10611061

10621062
/** @noinspection PhpUnhandledExceptionInspection */
1063-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1063+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
10641064
$fp->parse($code, 'relativePathName');
10651065
$cd = $fp->getClassDescriptions();
10661066

@@ -1092,7 +1092,7 @@ public function __construct(array $dtoList)
10921092
EOF;
10931093

10941094
/** @noinspection PhpUnhandledExceptionInspection */
1095-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1095+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
10961096
$fp->parse($code, 'relativePathName');
10971097
$cd = $fp->getClassDescriptions();
10981098

@@ -1127,7 +1127,7 @@ public function __construct(string $var1, array $dtoList, $var2, array $voList)
11271127
EOF;
11281128

11291129
/** @noinspection PhpUnhandledExceptionInspection */
1130-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1130+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
11311131
$fp->parse($code, 'relativePathName');
11321132
$cd = $fp->getClassDescriptions();
11331133

@@ -1160,7 +1160,7 @@ public function getList(): array
11601160
EOF;
11611161

11621162
/** @noinspection PhpUnhandledExceptionInspection */
1163-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1163+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
11641164
$fp->parse($code, 'relativePathName');
11651165
$cd = $fp->getClassDescriptions();
11661166

@@ -1193,7 +1193,7 @@ public function getList(): array
11931193
EOF;
11941194

11951195
/** @noinspection PhpUnhandledExceptionInspection */
1196-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1196+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
11971197
$fp->parse($code, 'relativePathName');
11981198
$cd = $fp->getClassDescriptions();
11991199

@@ -1226,7 +1226,7 @@ public function getList(): array
12261226
EOF;
12271227

12281228
/** @noinspection PhpUnhandledExceptionInspection */
1229-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
1229+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.4'));
12301230
$fp->parse($code, 'relativePathName');
12311231
$cd = $fp->getClassDescriptions();
12321232

tests/Unit/CLI/TargetPhpVersionTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public function test_it_should_ignore_the_patch_number(): void
2626

2727
public function test_it_should_ignore_extra_informations(): void
2828
{
29-
$targetPhpVersion = TargetPhpVersion::create('7.3.33-14+ubuntu22.04.1+deb.sury.org+1');
29+
$targetPhpVersion = TargetPhpVersion::create('7.4.10-14+ubuntu22.04.1+deb.sury.org+1');
3030

31-
$this->assertEquals('7.3', $targetPhpVersion->get());
31+
$this->assertEquals('7.4', $targetPhpVersion->get());
3232
}
3333

3434
public function test_it_should_throw_exception_if_not_valid_php_version(): void

0 commit comments

Comments
 (0)