Skip to content

Commit 6f70e63

Browse files
committed
Drop PHP 7.4 support
1 parent d89bd6d commit 6f70e63

File tree

6 files changed

+34
-23
lines changed

6 files changed

+34
-23
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
name: Build and test
1616
strategy:
1717
matrix:
18-
php: [7.4, 8.0]
18+
php: ['8.0']
1919
deps: [high]
2020
include:
21-
- php: 8.0
21+
- php: '8.0'
2222
deps: low
2323

2424
steps:
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Upload the phar
4444
uses: actions/upload-artifact@v1
45-
if: matrix.php == '7.4' && matrix.deps == 'high'
45+
if: matrix.php == '8.0' && matrix.deps == 'high'
4646
with:
4747
name: zalas-phpunit-injector-extension.phar
4848
path: build/zalas-phpunit-injector-extension.phar

Makefile

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IS_PHP8:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.0", ">=");')
1+
IS_PHP81:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.1", ">=");')
22

33
default: build
44

@@ -27,7 +27,7 @@ test: vendor cs deptrac phpunit infection
2727
test-min: update-min cs deptrac phpunit infection
2828
.PHONY: test-min
2929

30-
ifeq ($(IS_PHP8),1)
30+
ifeq ($(IS_PHP81),1)
3131
test-package:
3232
else
3333
test-package: package test-package-tools
@@ -36,15 +36,15 @@ endif
3636
.PHONY: test-package
3737

3838

39-
ifeq ($(IS_PHP8),1)
39+
ifeq ($(IS_PHP81),1)
4040
cs:
4141
else
4242
cs: tools/php-cs-fixer
4343
PHP_CS_FIXER_IGNORE_ENV=1 tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi --diff fix
4444
endif
4545
.PHONY: cs
4646

47-
ifeq ($(IS_PHP8),1)
47+
ifeq ($(IS_PHP81),1)
4848
cs-fix:
4949
else
5050
cs-fix: tools/php-cs-fixer
@@ -53,14 +53,14 @@ endif
5353
.PHONY: cs-fix
5454

5555
deptrac: tools/deptrac
56-
tools/deptrac --no-interaction --ansi --formatter-graphviz-display=0
56+
tools/deptrac --no-interaction --ansi
5757
.PHONY: deptrac
5858

59-
ifeq ($(IS_PHP8),1)
59+
ifeq ($(IS_PHP81),1)
6060
infection:
6161
else
6262
infection: tools/infection tools/infection.pubkey
63-
phpdbg -qrr ./tools/infection --no-interaction --formatter=progress --min-msi=95 --min-covered-msi=95 --only-covered --ansi
63+
phpdbg -qrr ./tools/infection --no-interaction --formatter=progress --min-msi=100 --min-covered-msi=100 --only-covered --ansi
6464
endif
6565
.PHONY: infection
6666

@@ -81,7 +81,7 @@ clean:
8181
find tests/phar/tools -not -path '*/\.*' -type f -delete
8282
.PHONY: clean
8383

84-
ifeq ($(IS_PHP8),1)
84+
ifeq ($(IS_PHP81),1)
8585
package:
8686
else
8787
package: tools/box
@@ -93,7 +93,7 @@ package: tools/box
9393

9494
cd build/phar && \
9595
composer remove phpunit/phpunit --no-update && \
96-
composer config platform.php 7.4 && \
96+
composer config platform.php 8.0 && \
9797
composer update --no-dev -o -a
9898

9999
tools/box compile
@@ -113,16 +113,16 @@ tools/php-cs-fixer:
113113
curl -Ls http://cs.symfony.com/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
114114

115115
tools/deptrac:
116-
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.10.0/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
116+
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.19.1/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
117117

118118
tools/infection: tools/infection.pubkey
119-
curl -Ls https://github.com/infection/infection/releases/download/0.20.2/infection.phar -o tools/infection && chmod +x tools/infection
119+
curl -Ls https://github.com/infection/infection/releases/download/0.26.2/infection.phar -o tools/infection && chmod +x tools/infection
120120

121121
tools/infection.pubkey:
122-
curl -Ls https://github.com/infection/infection/releases/download/0.20.2/infection.phar.pubkey -o tools/infection.pubkey
122+
curl -Ls https://github.com/infection/infection/releases/download/0.26.2/infection.phar.pubkey -o tools/infection.pubkey
123123

124124
tools/box:
125-
curl -Ls https://github.com/humbug/box/releases/download/3.10.0/box.phar -o tools/box && chmod +x tools/box
125+
curl -Ls https://github.com/humbug/box/releases/download/3.14.0/box.phar -o tools/box && chmod +x tools/box
126126

127127
tests/phar/tools/phpunit:
128128
curl -Ls https://phar.phpunit.de/phpunit-9.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Injects services from a PSR-11 dependency injection container to PHPUnit test cases",
44
"type": "library",
55
"require": {
6-
"php": "^7.4 || ~8.0.0",
6+
"php": "~8.0.0",
77
"phpunit/phpunit": "^9.0",
88
"psr/container": "^1.0",
99
"zalas/injector": "^2.0"

infection.json.dist

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
"@default": true,
1313
"IdenticalEqual": false,
1414
"NotIdenticalNotEqual": false,
15-
"OneZeroInteger": {
15+
"Assignment": {
16+
"ignore": [
17+
"Zalas\\Injector\\PHPUnit\\Symfony\\Compiler\\Discovery\\ClassFinder::findClassInFile"
18+
]
19+
},
20+
"Increment": {
1621
"ignore": [
1722
"Zalas\\Injector\\PHPUnit\\Symfony\\Compiler\\Discovery\\ClassFinder::findClassInFile"
1823
]
@@ -29,6 +34,16 @@
2934
"Zalas\\Injector\\PHPUnit\\Symfony\\Compiler\\Discovery\\PropertyDiscovery::__construct",
3035
"Zalas\\Injector\\PHPUnit\\TestListener\\ServiceInjectorListener::startTest"
3136
]
37+
},
38+
"InstanceOf_": {
39+
"ignore": [
40+
"Zalas\\Injector\\PHPUnit\\Symfony\\TestCase\\SymfonyKernel::ensureKernelShutdown"
41+
]
42+
},
43+
"LogicalOr": {
44+
"ignore": [
45+
"Zalas\\Injector\\PHPUnit\\Symfony\\TestCase\\SymfonyKernel::ensureKernelShutdown"
46+
]
3247
}
3348
}
3449
}

manifest.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
</copyright>
1111

1212
<requires>
13-
<php version="^7.4 || ^8.0"/>
13+
<php version="^8.0"/>
1414
</requires>
1515
</phar>

src/Symfony/Compiler/Discovery/ClassFinder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ private function findClassInFile(\SplFileInfo $phpFile): ?string
6969

7070
private function isNamespaceToken($tokens, int $index): bool
7171
{
72-
if (PHP_VERSION_ID < 80000) {
73-
return $this->extractTokens($tokens, $index - 2, 3) === [T_NAMESPACE, T_WHITESPACE, T_STRING];
74-
}
75-
7672
return $this->extractTokens($tokens, $index - 2, 3) === [T_NAMESPACE, T_WHITESPACE, T_NAME_QUALIFIED];
7773
}
7874

0 commit comments

Comments
 (0)