Skip to content

Commit 7ee959e

Browse files
authored
Merge pull request #44 from jakzal/php-8.2
Add PHP 8.2 support
2 parents c77a178 + ae7d5ae commit 7ee959e

File tree

8 files changed

+114
-114
lines changed

8 files changed

+114
-114
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
name: Build and test
1616
strategy:
1717
matrix:
18-
php: ['8.0', '8.1']
18+
php: ['8.0', '8.1', '8.2']
1919
deps: [high]
2020
include:
21-
- php: '8.1'
21+
- php: '8.2'
2222
deps: low
2323

2424
steps:

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
/composer.lock
44
/tests/phar/.phpunit.result.cache
55
/vendor/
6-
/.php_cs.cache
6+
/.deptrac.cache
7+
/.php-cs-fixer.cache
78
/.phpunit.result.cache

.php_cs .php-cs-fixer.dist.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44
->in(['src', 'tests'])
55
;
66

7-
return PhpCsFixer\Config::create()
7+
return (new PhpCsFixer\Config())
88
->setRules([
99
'@PSR2' => true,
1010
'array_syntax' => ['syntax' => 'short'],
1111
'blank_line_before_statement' => true,
1212
'declare_strict_types' => true,
13-
'native_function_invocation' => true,
13+
'native_function_invocation' => ['include' => ['@internal'], 'scope' => 'all', 'strict' => true],
1414
'no_empty_comment' => true,
1515
'no_empty_phpdoc' => true,
1616
'no_empty_statement' => true,
1717
'no_extra_blank_lines' => true,
18-
'no_extra_consecutive_blank_lines' => true,
1918
'no_leading_import_slash' => true,
2019
'no_leading_namespace_whitespace' => true,
2120
'no_unused_imports' => true,

Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IS_PHP81:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.1", ">=");')
1+
IS_PHP82:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.2", ">=");')
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_PHP81),1)
30+
ifeq ($(IS_PHP82),1)
3131
test-package:
3232
else
3333
test-package: package test-package-tools
@@ -69,7 +69,7 @@ clean:
6969
find tests/phar/tools -not -path '*/\.*' -type f -delete
7070
.PHONY: clean
7171

72-
ifeq ($(IS_PHP81),1)
72+
ifeq ($(IS_PHP82),1)
7373
package:
7474
else
7575
package: tools/box
@@ -98,10 +98,10 @@ tools/phpunit: vendor/bin/phpunit
9898
ln -sf ../vendor/bin/phpunit tools/phpunit
9999

100100
tools/php-cs-fixer:
101-
curl -Ls http://cs.symfony.com/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
101+
curl -Ls http://cs.symfony.com/download/php-cs-fixer-v3.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
102102

103103
tools/deptrac:
104-
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.19.1/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
104+
curl -Ls https://github.com/sensiolabs-de/deptrac/releases/download/0.24.0/deptrac.phar -o tools/deptrac && chmod +x tools/deptrac
105105

106106
tools/infection: tools/infection.pubkey
107107
curl -Ls https://github.com/infection/infection/releases/download/0.26.2/infection.phar -o tools/infection && chmod +x tools/infection
@@ -110,7 +110,7 @@ tools/infection.pubkey:
110110
curl -Ls https://github.com/infection/infection/releases/download/0.26.2/infection.phar.pubkey -o tools/infection.pubkey
111111

112112
tools/box:
113-
curl -Ls https://github.com/humbug/box/releases/download/3.14.0/box.phar -o tools/box && chmod +x tools/box
113+
curl -Ls https://github.com/humbug/box/releases/download/3.16.0/box.phar -o tools/box && chmod +x tools/box
114114

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

composer.json

+1-1
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": "~8.0.0 || ~8.1.0",
6+
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
77
"phpunit/phpunit": "^9.0",
88
"psr/container": "^1.0 || ^2.0",
99
"zalas/injector": "^2.0"

depfile.yaml

-100
This file was deleted.

deptrac.yaml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
parameters:
2+
paths:
3+
- ./src
4+
exclude_files: []
5+
layers:
6+
- name: Symfony Compiler
7+
collectors:
8+
- type: className
9+
regex: ^Zalas\\Injector\\PHPUnit\\Symfony\\Compiler\\.*
10+
- name: Symfony TestCase
11+
collectors:
12+
- type: className
13+
regex: ^Zalas\\Injector\\PHPUnit\\Symfony\\TestCase\\.*
14+
- name: TestCase
15+
collectors:
16+
- type: className
17+
regex: ^Zalas\\Injector\\PHPUnit\\TestCase\\.*
18+
- name: TestListener
19+
collectors:
20+
- type: className
21+
regex: ^Zalas\\Injector\\PHPUnit\\TestListener\\.*
22+
- name: Injector Service
23+
collectors:
24+
- type: className
25+
regex: ^Zalas\\Injector\\Service\\.*
26+
- name: Injector Factory
27+
collectors:
28+
- type: className
29+
regex: ^Zalas\\Injector\\Factory\\.*
30+
- name: Psr Container
31+
collectors:
32+
- type: className
33+
regex: ^Psr\\Container\\.*
34+
- name: Symfony Config
35+
collectors:
36+
- type: className
37+
regex: ^Symfony\\Component\\Config\\.*
38+
- name: Symfony DependencyInjection
39+
collectors:
40+
- type: className
41+
regex: ^Symfony\\Component\\DependencyInjection\\.*
42+
- name: Symfony HttpKernel
43+
collectors:
44+
- type: className
45+
regex: ^Symfony\\Component\\HttpKernel\\.*
46+
- name: Symfony Service Contracts
47+
collectors:
48+
- type: className
49+
regex: ^Symfony\\Contracts\\Service\\.*
50+
- name: PHPUnit
51+
collectors:
52+
- type: className
53+
regex: ^PHPUnit\\Framework\\.*
54+
- name: Other Vendors
55+
collectors:
56+
- type: bool
57+
must:
58+
# must be outside of global namespace
59+
- type: className
60+
regex: '[\\]+'
61+
must_not:
62+
# must not be one of the known vendors
63+
- type: className
64+
regex: ^Zalas\\Injector\\PHPUnit\\.*
65+
- type: className
66+
regex: ^Zalas\\Injector\\Service\\.*
67+
- type: className
68+
regex: ^Zalas\\Injector\\Factory\\.*
69+
- type: className
70+
regex: ^Psr\\Container\\.*
71+
- type: className
72+
regex: ^PHPUnit\\Framework\\.*
73+
- type: className
74+
regex: ^Symfony\\Component\\Config\\.*
75+
- type: className
76+
regex: ^Symfony\\Component\\DependencyInjection\\.*
77+
- type: className
78+
regex: ^Symfony\\Component\\HttpKernel\\.*
79+
- type: className
80+
regex: ^Symfony\\Contracts\\Service\\.*
81+
ruleset:
82+
Symfony Compiler:
83+
- Injector Factory
84+
- Injector Service
85+
- PHPUnit
86+
- TestCase
87+
- Symfony Config
88+
- Symfony DependencyInjection
89+
Symfony TestCase:
90+
- Psr Container
91+
- Symfony DependencyInjection
92+
- Symfony HttpKernel
93+
- Symfony Service Contracts
94+
TestCase:
95+
- Psr Container
96+
TestListener:
97+
- TestCase
98+
- Injector Service
99+
- Injector Factory
100+
- Psr Container
101+
- PHPUnit

tests/Symfony/TestCase/Fixtures/NoFrameworkBundle/AnotherTestKernel.php

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
use Symfony\Component\Config\Loader\LoaderInterface;
77
use Symfony\Component\DependencyInjection\ContainerBuilder;
8-
use Symfony\Component\DependencyInjection\Reference;
98
use Symfony\Component\HttpKernel\Kernel;
109
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\ClassFinder;
1110
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\PropertyDiscovery;

0 commit comments

Comments
 (0)