Skip to content

Commit

Permalink
Merge pull request #44 from jakzal/php-8.2
Browse files Browse the repository at this point in the history
Add PHP 8.2 support
  • Loading branch information
jakzal authored Dec 18, 2022
2 parents c77a178 + ae7d5ae commit 7ee959e
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 114 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
name: Build and test
strategy:
matrix:
php: ['8.0', '8.1']
php: ['8.0', '8.1', '8.2']
deps: [high]
include:
- php: '8.1'
- php: '8.2'
deps: low

steps:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
/composer.lock
/tests/phar/.phpunit.result.cache
/vendor/
/.php_cs.cache
/.deptrac.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
5 changes: 2 additions & 3 deletions .php_cs → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
->in(['src', 'tests'])
;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => true,
'declare_strict_types' => true,
'native_function_invocation' => true,
'native_function_invocation' => ['include' => ['@internal'], 'scope' => 'all', 'strict' => true],
'no_empty_comment' => true,
'no_empty_phpdoc' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'no_extra_consecutive_blank_lines' => true,
'no_leading_import_slash' => true,
'no_leading_namespace_whitespace' => true,
'no_unused_imports' => true,
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
IS_PHP81:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.1", ">=");')
IS_PHP82:=$(shell php -r 'echo (int)version_compare(PHP_VERSION, "8.2", ">=");')

default: build

Expand Down Expand Up @@ -27,7 +27,7 @@ test: vendor cs deptrac phpunit infection
test-min: update-min cs deptrac phpunit infection
.PHONY: test-min

ifeq ($(IS_PHP81),1)
ifeq ($(IS_PHP82),1)
test-package:
else
test-package: package test-package-tools
Expand Down Expand Up @@ -69,7 +69,7 @@ clean:
find tests/phar/tools -not -path '*/\.*' -type f -delete
.PHONY: clean

ifeq ($(IS_PHP81),1)
ifeq ($(IS_PHP82),1)
package:
else
package: tools/box
Expand Down Expand Up @@ -98,10 +98,10 @@ tools/phpunit: vendor/bin/phpunit
ln -sf ../vendor/bin/phpunit tools/phpunit

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

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

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

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

tests/phar/tools/phpunit:
curl -Ls https://phar.phpunit.de/phpunit-9.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Injects services from a PSR-11 dependency injection container to PHPUnit test cases",
"type": "library",
"require": {
"php": "~8.0.0 || ~8.1.0",
"php": "~8.0.0 || ~8.1.0 || ~8.2.0",
"phpunit/phpunit": "^9.0",
"psr/container": "^1.0 || ^2.0",
"zalas/injector": "^2.0"
Expand Down
100 changes: 0 additions & 100 deletions depfile.yaml

This file was deleted.

101 changes: 101 additions & 0 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
parameters:
paths:
- ./src
exclude_files: []
layers:
- name: Symfony Compiler
collectors:
- type: className
regex: ^Zalas\\Injector\\PHPUnit\\Symfony\\Compiler\\.*
- name: Symfony TestCase
collectors:
- type: className
regex: ^Zalas\\Injector\\PHPUnit\\Symfony\\TestCase\\.*
- name: TestCase
collectors:
- type: className
regex: ^Zalas\\Injector\\PHPUnit\\TestCase\\.*
- name: TestListener
collectors:
- type: className
regex: ^Zalas\\Injector\\PHPUnit\\TestListener\\.*
- name: Injector Service
collectors:
- type: className
regex: ^Zalas\\Injector\\Service\\.*
- name: Injector Factory
collectors:
- type: className
regex: ^Zalas\\Injector\\Factory\\.*
- name: Psr Container
collectors:
- type: className
regex: ^Psr\\Container\\.*
- name: Symfony Config
collectors:
- type: className
regex: ^Symfony\\Component\\Config\\.*
- name: Symfony DependencyInjection
collectors:
- type: className
regex: ^Symfony\\Component\\DependencyInjection\\.*
- name: Symfony HttpKernel
collectors:
- type: className
regex: ^Symfony\\Component\\HttpKernel\\.*
- name: Symfony Service Contracts
collectors:
- type: className
regex: ^Symfony\\Contracts\\Service\\.*
- name: PHPUnit
collectors:
- type: className
regex: ^PHPUnit\\Framework\\.*
- name: Other Vendors
collectors:
- type: bool
must:
# must be outside of global namespace
- type: className
regex: '[\\]+'
must_not:
# must not be one of the known vendors
- type: className
regex: ^Zalas\\Injector\\PHPUnit\\.*
- type: className
regex: ^Zalas\\Injector\\Service\\.*
- type: className
regex: ^Zalas\\Injector\\Factory\\.*
- type: className
regex: ^Psr\\Container\\.*
- type: className
regex: ^PHPUnit\\Framework\\.*
- type: className
regex: ^Symfony\\Component\\Config\\.*
- type: className
regex: ^Symfony\\Component\\DependencyInjection\\.*
- type: className
regex: ^Symfony\\Component\\HttpKernel\\.*
- type: className
regex: ^Symfony\\Contracts\\Service\\.*
ruleset:
Symfony Compiler:
- Injector Factory
- Injector Service
- PHPUnit
- TestCase
- Symfony Config
- Symfony DependencyInjection
Symfony TestCase:
- Psr Container
- Symfony DependencyInjection
- Symfony HttpKernel
- Symfony Service Contracts
TestCase:
- Psr Container
TestListener:
- TestCase
- Injector Service
- Injector Factory
- Psr Container
- PHPUnit
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Kernel;
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\ClassFinder;
use Zalas\Injector\PHPUnit\Symfony\Compiler\Discovery\PropertyDiscovery;
Expand Down

0 comments on commit 7ee959e

Please sign in to comment.