Skip to content

Commit e162c85

Browse files
Removes support for php 7.1 (#446)
* removes support for php 7.1 * bumps min parser version in tests to 7.2 * bump some github action version
1 parent c82446b commit e162c85

File tree

9 files changed

+35
-35
lines changed

9 files changed

+35
-35
lines changed

.github/workflows/architectural-rules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
steps:
1313
- name: "Checkout"
14-
uses: actions/checkout@v2
14+
uses: actions/checkout@v3
1515

1616
- name: PHPArkitect
1717
uses: docker://phparkitect/arkitect-github-actions:latest

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
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.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
16+
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
1717
coverage-driver: [ 'pcov' ]
1818

1919
steps:
@@ -32,7 +32,7 @@ jobs:
3232

3333
- name: Cache Composer packages
3434
id: composer-cache
35-
uses: actions/cache@v2
35+
uses: actions/cache@v4
3636
with:
3737
path: vendor
3838
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
@@ -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.1' }}
55+
if: ${{ matrix.php-versions == '7.2' }}
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.1
69+
php-version: 7.2
7070
tools: composer:v2.2
7171
env:
7272
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
@@ -84,7 +84,7 @@ jobs:
8484
run: mv ./phparkitect.phar phparkitect-${{ github.sha }}.phar
8585

8686
- name: "Upload phar file artifact"
87-
uses: actions/upload-artifact@v3
87+
uses: actions/upload-artifact@v4
8888
with:
8989
name: phar-artifact
9090
path: ./phparkitect-${{ github.sha }}.phar
@@ -95,7 +95,7 @@ jobs:
9595
runs-on: "ubuntu-20.04"
9696
strategy:
9797
matrix:
98-
php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0', '8.1' ]
98+
php-versions: [ '7.2', '7.3', '7.4', '8.0', '8.1' ]
9999
coverage-driver: [ 'pcov' ]
100100

101101
steps:
@@ -107,7 +107,7 @@ jobs:
107107
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
108108

109109
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
110-
uses: actions/download-artifact@v3
110+
uses: actions/download-artifact@v4
111111
with:
112112
# will download phar in project root
113113
name: phar-artifact
@@ -121,7 +121,7 @@ jobs:
121121
if: github.event_name == 'release'
122122
steps:
123123
- name: "Download phar ./phparkitect-${{ github.sha }}.phar"
124-
uses: actions/download-artifact@v3
124+
uses: actions/download-artifact@v4
125125
with:
126126
# will download phar in project root
127127
name: phar-artifact

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG PHP_VERSION=7.1
1+
ARG PHP_VERSION=7.2
22

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

README.md

Lines changed: 1 addition & 1 deletion
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.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2
467+
Supported PHP versions are: 7.2, 7.3, 7.4, 8.0, 8.1, 8.2
468468
* `--stop-on-failure`: With this option the process will end immediately after the first violation.
469469

470470
## Run only a specific rule

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Enforce architectural constraints in your PHP applications",
44
"type": "library",
55
"license": "MIT",
6-
"version": "0.3.33",
6+
"version": "0.4.0",
77
"authors": [
88
{
99
"name": "Pietro Campagnano",
@@ -23,7 +23,7 @@
2323
}
2424
],
2525
"require": {
26-
"php": "^7.1|^8",
26+
"php": "^7.2|^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",
@@ -38,10 +38,10 @@
3838
"roave/security-advisories": "dev-master",
3939
"symfony/var-dumper": "^3.0|^4.0|^5.0|^6.0|^7.0",
4040
"vimeo/psalm": "^4.6",
41-
"friendsofphp/php-cs-fixer": "^3.0",
4241
"phpunit/phpunit": "^7.5|^9.0|^10.0",
4342
"mikey179/vfsstream": "^1.6",
44-
"phpspec/prophecy": "^1.10"
43+
"phpspec/prophecy": "^1.10",
44+
"friendsofphp/php-cs-fixer": "3.4.0"
4545
},
4646
"autoload": {
4747
"psr-4": {
@@ -59,4 +59,4 @@
5959
"bin": [
6060
"bin-stub/phparkitect"
6161
]
62-
}
62+
}

composer.phar

655 KB
Binary file not shown.

src/CLI/TargetPhpVersion.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
class TargetPhpVersion
1010
{
1111
public const VALID_PHP_VERSIONS = [
12-
'7.1',
1312
'7.2',
1413
'7.3',
1514
'7.4',

tests/Unit/Analyzer/FileVisitorTest.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace Arkitect\Tests\Unit\Analyzer;
@@ -39,7 +40,7 @@ class Cat implements AnInterface
3940
EOF;
4041

4142
/** @var FileParser $fp */
42-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
43+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
4344
$fp->parse($code, 'relativePathName');
4445
$cd = $fp->getClassDescriptions();
4546

@@ -84,7 +85,7 @@ class Cat implements AnInterface
8485
EOF;
8586

8687
/** @var FileParser $fp */
87-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
88+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
8889
$fp->parse($code, 'relativePathName');
8990
$cd = $fp->getClassDescriptions();
9091

@@ -120,7 +121,7 @@ class Cat extends Animal
120121
EOF;
121122

122123
/** @var FileParser $fp */
123-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
124+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
124125
$fp->parse($code, 'relativePathName');
125126

126127
$cd = $fp->getClassDescriptions()[1];
@@ -149,7 +150,7 @@ public function methodWithAnonymous(): void
149150
EOF;
150151

151152
/** @var FileParser $fp */
152-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
153+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
153154
$fp->parse($code, 'relativePathName');
154155

155156
$cd = $fp->getClassDescriptions()[1];
@@ -177,7 +178,7 @@ public function __construct(Request $request)
177178
EOF;
178179

179180
/** @var FileParser $fp */
180-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
181+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
181182
$fp->parse($code, 'relativePathName');
182183
$cd = $fp->getClassDescriptions();
183184

@@ -212,7 +213,7 @@ public function __construct(Request $request, ?Nullable $nullable)
212213
EOF;
213214

214215
/** @var FileParser $fp */
215-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
216+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
216217
$fp->parse($code, 'relativePathName');
217218
$cd = $fp->getClassDescriptions();
218219

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

849850
/** @var FileParser $fp */
850-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
851+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
851852
$fp->parse($code, 'relativePathName');
852853
$cd = $fp->getClassDescriptions();
853854

@@ -935,7 +936,7 @@ class MyClass
935936
EOF;
936937

937938
/** @noinspection PhpUnhandledExceptionInspection */
938-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
939+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
939940
$fp->parse($code, 'relativePathName');
940941
$cd = $fp->getClassDescriptions();
941942

@@ -965,7 +966,7 @@ class MyClass
965966
EOF;
966967

967968
/** @noinspection PhpUnhandledExceptionInspection */
968-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
969+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
969970
$fp->parse($code, 'relativePathName');
970971
$cd = $fp->getClassDescriptions();
971972

@@ -995,7 +996,7 @@ class MyClass
995996
EOF;
996997

997998
/** @noinspection PhpUnhandledExceptionInspection */
998-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
999+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
9991000
$fp->parse($code, 'relativePathName');
10001001
$cd = $fp->getClassDescriptions();
10011002

@@ -1027,7 +1028,7 @@ public function __construct(array $dtoList)
10271028
EOF;
10281029

10291030
/** @noinspection PhpUnhandledExceptionInspection */
1030-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1031+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
10311032
$fp->parse($code, 'relativePathName');
10321033
$cd = $fp->getClassDescriptions();
10331034

@@ -1059,7 +1060,7 @@ public function __construct(array $dtoList)
10591060
EOF;
10601061

10611062
/** @noinspection PhpUnhandledExceptionInspection */
1062-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1063+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
10631064
$fp->parse($code, 'relativePathName');
10641065
$cd = $fp->getClassDescriptions();
10651066

@@ -1091,7 +1092,7 @@ public function __construct(array $dtoList)
10911092
EOF;
10921093

10931094
/** @noinspection PhpUnhandledExceptionInspection */
1094-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1095+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
10951096
$fp->parse($code, 'relativePathName');
10961097
$cd = $fp->getClassDescriptions();
10971098

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

11281129
/** @noinspection PhpUnhandledExceptionInspection */
1129-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1130+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
11301131
$fp->parse($code, 'relativePathName');
11311132
$cd = $fp->getClassDescriptions();
11321133

@@ -1159,7 +1160,7 @@ public function getList(): array
11591160
EOF;
11601161

11611162
/** @noinspection PhpUnhandledExceptionInspection */
1162-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1163+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
11631164
$fp->parse($code, 'relativePathName');
11641165
$cd = $fp->getClassDescriptions();
11651166

@@ -1192,7 +1193,7 @@ public function getList(): array
11921193
EOF;
11931194

11941195
/** @noinspection PhpUnhandledExceptionInspection */
1195-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1196+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
11961197
$fp->parse($code, 'relativePathName');
11971198
$cd = $fp->getClassDescriptions();
11981199

@@ -1225,7 +1226,7 @@ public function getList(): array
12251226
EOF;
12261227

12271228
/** @noinspection PhpUnhandledExceptionInspection */
1228-
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.1'));
1229+
$fp = FileParserFactory::createFileParser(TargetPhpVersion::create('7.2'));
12291230
$fp->parse($code, 'relativePathName');
12301231
$cd = $fp->getClassDescriptions();
12311232

tests/Unit/CLI/VersionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ class VersionTest extends TestCase
1111
{
1212
public function test_it_should_return_version(): void
1313
{
14-
$this->assertEquals('0.3.33', Version::get());
14+
$this->assertEquals('0.4.0', Version::get());
1515
}
1616
}

0 commit comments

Comments
 (0)