Skip to content

Commit aef70d2

Browse files
committed
Remove support for Symfony 5 and PHP 7
1 parent 76bc458 commit aef70d2

23 files changed

Lines changed: 240 additions & 939 deletions

.gitattributes

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
* text=auto
2-
31
# Always use LF
42
core.autocrlf=lf
53

6-
.editorconfig
4+
.editorconfig export-ignore
75
.gitattributes export-ignore
86
.gitignore export-ignore
9-
.php_cs export-ignore
10-
.scrutinizer.yml export-ignore
11-
.travis.yml export-ignore
127
.github export-ignore
8+
.php-cs-fixer.dist.php export-ignore
9+
CODE_OF_CONDUCT.md export-ignore
10+
Makefile export-ignore
1311
phpunit.xml.dist export-ignore
14-
/tests export-ignore
12+
phpstan.neon export-ignore
13+
phpstan-baseline.neon export-ignore
14+
tests/ export-ignore

.github/workflows/ci.yaml

Lines changed: 124 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Full CI process
1+
name: 'CI'
2+
23
on:
34
push:
45
branches:
@@ -8,92 +9,149 @@ on:
89
- main
910

1011
jobs:
11-
test:
12-
name: PHP ${{ matrix.PHP_VERSION }}
13-
runs-on: ubuntu-latest
12+
cs-fixer:
13+
name: 'PHP CS Fixer'
14+
15+
runs-on: 'ubuntu-latest'
16+
1417
strategy:
15-
fail-fast: false
1618
matrix:
17-
include:
18-
- PHP_VERSION: '7.1'
19-
SYMFONY_REQUIRE: '^3.4'
20-
- PHP_VERSION: '7.2'
21-
SYMFONY_REQUIRE: '^4.4'
22-
- PHP_VERSION: '7.3'
23-
SYMFONY_REQUIRE: '^5.0'
24-
- PHP_VERSION: '7.4'
25-
SYMFONY_REQUIRE: '^5.2'
26-
- PHP_VERSION: '8.0'
27-
SYMFONY_REQUIRE: '^5.3'
28-
- PHP_VERSION: '8.0'
29-
SYMFONY_REQUIRE: '^6.0'
19+
php-version:
20+
- '8.2'
3021

3122
steps:
32-
# —— Setup Github actions 🐙 —————————————————————————————————————————————
33-
# https://github.com/actions/checkout (official)
3423
-
35-
name: Checkout
36-
uses: actions/checkout@v2
24+
name: 'Check out'
25+
uses: 'actions/checkout@v4'
3726

38-
# https://github.com/shivammathur/setup-php (community)
3927
-
40-
name: Setup PHP, extensions and composer with shivammathur/setup-php
41-
uses: shivammathur/setup-php@v2
28+
name: 'Set up PHP'
29+
uses: 'shivammathur/setup-php@v2'
4230
with:
43-
php-version: ${{ matrix.PHP_VERSION }}
44-
extensions: mbstring, ctype, iconv, bcmath, filter, json
45-
coverage: none
46-
env:
47-
update: true
31+
php-version: '${{ matrix.php-version }}'
32+
coverage: 'none'
4833

49-
# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
5034
-
51-
name: Install Composer dependencies
52-
env:
53-
SYMFONY_REQUIRE: ${{ matrix.SYMFONY_REQUIRE }}
54-
SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE: 1
55-
SYMFONY_PHPUNIT_VERSION: '7.5.6'
56-
run: |
57-
git config --global author.name Sebastiaan Stok
58-
git config --global author.email s.stok@rollerscapes.net
59-
git config --global user.name Sebastiaan Stok
60-
git config --global user.email s.stok@rollerscapes.net
35+
name: 'Get Composer cache directory'
36+
id: 'composer-cache'
37+
run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
38+
39+
-
40+
name: 'Cache dependencies'
41+
uses: 'actions/cache@v3'
42+
with:
43+
path: '${{ steps.composer-cache.outputs.cache_dir }}'
44+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
45+
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'
6146

62-
rm -f composer.lock
63-
composer install --no-progress --no-interaction --optimize-autoloader --ansi
47+
-
48+
name: 'Install dependencies'
49+
run: 'composer install --no-progress'
6450

65-
## —— Tests ✅ ———————————————————————————————————————————————————————————
6651
-
67-
name: Run Tests
68-
run: |
69-
make test
70-
lint:
71-
name: PHP-QA
72-
runs-on: ubuntu-latest
52+
name: 'Check the code style'
53+
run: 'make cs'
54+
55+
phpstan:
56+
name: 'PhpStan'
57+
58+
runs-on: 'ubuntu-latest'
59+
7360
strategy:
74-
fail-fast: false
61+
matrix:
62+
php-version:
63+
- '8.2'
64+
7565
steps:
7666
-
77-
name: Checkout
78-
uses: actions/checkout@v2
67+
name: 'Check out'
68+
uses: 'actions/checkout@v4'
7969

80-
# https://github.com/shivammathur/setup-php (community)
8170
-
82-
name: Setup PHP, extensions and composer with shivammathur/setup-php
83-
uses: shivammathur/setup-php@v2
71+
name: 'Set up PHP'
72+
uses: 'shivammathur/setup-php@v2'
8473
with:
85-
php-version: '7.4'
86-
extensions: mbstring, ctype, iconv, bcmath, filter, json
87-
coverage: none
74+
php-version: '${{ matrix.php-version }}'
75+
coverage: 'none'
8876

89-
# —— Composer 🧙‍️ —————————————————————————————————————————————————————————
9077
-
91-
name: Install Composer dependencies
92-
run: |
93-
rm -f composer.lock
94-
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --ansi
78+
name: 'Get Composer cache directory'
79+
id: 'composer-cache'
80+
run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
81+
82+
-
83+
name: 'Cache dependencies'
84+
uses: 'actions/cache@v3'
85+
with:
86+
path: '${{ steps.composer-cache.outputs.cache_dir }}'
87+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
88+
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'
89+
90+
-
91+
name: 'Install dependencies'
92+
run: 'composer install --no-progress'
9593

9694
-
97-
name: Run PHP-QA
95+
name: 'Run PhpStan'
96+
run: 'vendor/bin/phpstan analyze --no-progress'
97+
98+
tests:
99+
name: 'PHPUnit'
100+
101+
runs-on: 'ubuntu-latest'
102+
103+
strategy:
104+
matrix:
105+
include:
106+
-
107+
php-version: '8.2'
108+
composer-options: '--prefer-stable'
109+
symfony-version: '6.3'
110+
-
111+
php-version: '8.2'
112+
composer-options: '--prefer-stable'
113+
symfony-version: '^6.4'
114+
115+
-
116+
php-version: '8.2'
117+
composer-options: '--prefer-stable'
118+
symfony-version: '^7.0'
119+
120+
steps:
121+
-
122+
name: 'Check out'
123+
uses: 'actions/checkout@v4'
124+
125+
-
126+
name: 'Set up PHP'
127+
uses: 'shivammathur/setup-php@v2'
128+
with:
129+
php-version: '${{ matrix.php-version }}'
130+
coverage: 'none'
131+
132+
-
133+
name: 'Get Composer cache directory'
134+
id: 'composer-cache'
135+
run: 'echo "cache_dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
136+
137+
-
138+
name: 'Cache dependencies'
139+
uses: 'actions/cache@v3'
140+
with:
141+
path: '${{ steps.composer-cache.outputs.cache_dir }}'
142+
key: "php-${{ matrix.php-version }}-composer-locked-${{ hashFiles('composer.lock') }}"
143+
restore-keys: 'php-${{ matrix.php-version }}-composer-locked-'
144+
145+
-
146+
name: 'Install dependencies'
147+
env:
148+
COMPOSER_OPTIONS: '${{ matrix.composer-options }}'
149+
SYMFONY_REQUIRE: '${{ matrix.symfony-version }}'
98150
run: |
99-
make cs-full
151+
composer global config --no-plugins allow-plugins.symfony/flex true
152+
composer global require --no-progress --no-scripts --no-plugins symfony/flex
153+
composer update --no-progress $COMPOSER_OPTIONS
154+
155+
-
156+
name: 'Run tests'
157+
run: make phpunit

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/phpunit.xml
2-
/composer.lock
3-
*.phar
1+
composer.lock
42
/vendor/
5-
/.php_cs.cache
6-
symfony.lock
3+
4+
phpunit.xml
75
.phpunit.result.cache
6+
.phpunit.cache/
7+
.phpunit
8+
9+
.php-cs-fixer.cache

.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
$header = <<<EOF
4+
This file is part of the RollerworksPasswordStrengthBundle package.
5+
6+
(c) Sebastiaan Stok <s.stok@rollerscapes.net>
7+
8+
This source file is subject to the MIT license that is bundled
9+
with this source code in the file LICENSE.
10+
EOF;
11+
12+
/** @var \Symfony\Component\Finder\Finder $finder */
13+
$finder = PhpCsFixer\Finder::create();
14+
$finder
15+
->in([
16+
__DIR__ . '/src',
17+
__DIR__ . '/tests',
18+
]);
19+
20+
$config = new PhpCsFixer\Config();
21+
$config
22+
->setRiskyAllowed(true)
23+
->setRules(
24+
array_merge(
25+
require __DIR__ . '/vendor/rollerscapes/standards/php-cs-fixer-rules.php',
26+
['header_comment' => ['header' => $header]])
27+
)
28+
->setFinder($finder);
29+
30+
return $config;

.php_cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2018 Sebastiaan Stok
1+
Copyright (c) 2012-present Sebastiaan Stok
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,4 @@
1-
QA_DOCKER_IMAGE=jakzal/phpqa:1.34.1-php7.4-alpine
2-
QA_DOCKER_COMMAND=docker run --init -t --rm --user "$(shell id -u):$(shell id -g)" --volume /tmp/tmp-phpqa-$(shell id -u):/tmp --volume "$(shell pwd):/project" --workdir /project ${QA_DOCKER_IMAGE}
1+
include vendor/rollerscapes/standards/Makefile
32

4-
dist: install cs-full phpstan test-full
5-
lint: install security-check cs-full phpstan
6-
7-
install:
8-
composer install --no-progress --no-interaction --no-suggest --optimize-autoloader --prefer-dist --ansi
9-
10-
test:
11-
./vendor/bin/simple-phpunit --verbose
12-
13-
# Linting tools
14-
security-check: ensure
15-
sh -c "${QA_DOCKER_COMMAND} security-checker security:check ./composer.lock"
16-
17-
phpstan: ensure
18-
sh -c "${QA_DOCKER_COMMAND} phpstan analyse --configuration phpstan.neon"
19-
20-
cs: ensure
21-
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --diff"
22-
23-
cs-full: ensure
24-
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --using-cache=false --diff"
25-
26-
cs-full-check: ensure
27-
sh -c "${QA_DOCKER_COMMAND} php-cs-fixer fix -vvv --using-cache=false --diff --dry-run"
28-
29-
ensure:
30-
mkdir -p ${HOME}/.composer /tmp/tmp-phpqa-$(shell id -u)
31-
32-
.PHONY: install test phpstan cs cs-full cs-full-check
3+
phpunit:
4+
./vendor/bin/phpunit

0 commit comments

Comments
 (0)