Skip to content

Commit 8a9a994

Browse files
committed
require php >= 8.1
1 parent b477a36 commit 8a9a994

File tree

14 files changed

+341
-14
lines changed

14 files changed

+341
-14
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Check Coding Standards"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
coding-standards:
13+
name: "Check Coding Standards"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "8.1"
23+
- "8.2"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v2"
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
38+
- name: "Cache dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.composer/cache
43+
vendor
44+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46+
47+
- name: "Install lowest dependencies"
48+
if: ${{ matrix.dependencies == 'lowest' }}
49+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install highest dependencies"
52+
if: ${{ matrix.dependencies == 'highest' }}
53+
run: "composer update --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Install locked dependencies"
56+
if: ${{ matrix.dependencies == 'locked' }}
57+
run: "composer install --no-interaction --no-progress --no-suggest"
58+
59+
- name: "Coding Standard"
60+
run: "vendor/bin/phpcs"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Mutation tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
mutation-tests:
13+
name: "Mutation tests"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "8.1"
23+
- "8.2"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v2"
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
38+
- name: "Cache dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.composer/cache
43+
vendor
44+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46+
47+
- name: "Install lowest dependencies"
48+
if: ${{ matrix.dependencies == 'lowest' }}
49+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install highest dependencies"
52+
if: ${{ matrix.dependencies == 'highest' }}
53+
run: "composer update --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Install locked dependencies"
56+
if: ${{ matrix.dependencies == 'locked' }}
57+
run: "composer install --no-interaction --no-progress --no-suggest"
58+
59+
- name: "Infection"
60+
run: "vendor/bin/infection"
61+
env:
62+
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
63+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
64+

.github/workflows/phpunit.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "PHPUnit tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
phpunit:
13+
name: "PHPUnit tests"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "8.1"
23+
- "8.2"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v2"
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
38+
- name: "Cache dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.composer/cache
43+
vendor
44+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46+
47+
- name: "Install lowest dependencies"
48+
if: ${{ matrix.dependencies == 'lowest' }}
49+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install highest dependencies"
52+
if: ${{ matrix.dependencies == 'highest' }}
53+
run: "composer update --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Install locked dependencies"
56+
if: ${{ matrix.dependencies == 'locked' }}
57+
run: "composer install --no-interaction --no-progress --no-suggest"
58+
59+
- name: "Tests"
60+
run: "vendor/bin/phpunit"

.github/workflows/psalm.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Static Analysis by Psalm"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "3.x.x"
10+
11+
jobs:
12+
static-analysis-psalm:
13+
name: "Static Analysis by Psalm"
14+
15+
runs-on: ${{ matrix.operating-system }}
16+
17+
strategy:
18+
matrix:
19+
dependencies:
20+
- "locked"
21+
php-version:
22+
- "8.1"
23+
- "8.2"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: "actions/checkout@v2"
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
38+
- name: "Cache dependencies"
39+
uses: "actions/cache@v2"
40+
with:
41+
path: |
42+
~/.composer/cache
43+
vendor
44+
key: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
45+
restore-keys: "php-${{ matrix.php-version }}-${{ matrix.dependencies }}"
46+
47+
- name: "Install lowest dependencies"
48+
if: ${{ matrix.dependencies == 'lowest' }}
49+
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"
50+
51+
- name: "Install highest dependencies"
52+
if: ${{ matrix.dependencies == 'highest' }}
53+
run: "composer update --no-interaction --no-progress --no-suggest"
54+
55+
- name: "Install locked dependencies"
56+
if: ${{ matrix.dependencies == 'locked' }}
57+
run: "composer install --no-interaction --no-progress --no-suggest"
58+
59+
- name: "psalm"
60+
run: "vendor/bin/psalm --shepherd --stats"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/.phpunit.result.cache
22
/composer.lock
33
/coverage
4+
/infection.log
45
/vendor

composer.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@
1212
}
1313
],
1414
"require": {
15-
"php": "^7.4.0|^8.0",
16-
"psr/container": "^1.0.0",
17-
"symfony/console": "^4.2 || ^5.0"
15+
"php": "~8.1.0 || ~8.2.0",
16+
"psr/container": "^2.0",
17+
"symfony/console": "^5.0 || ^6.0"
1818
},
1919
"require-dev": {
20-
"phpro/grumphp": "~0.17 || ~1.0",
21-
"phpstan/phpstan": "^0.11.5 || ^0.12.0",
22-
"phpunit/phpunit": "^8.0 || ^9.0",
23-
"squizlabs/php_codesniffer": "^3.4",
24-
"symfony/var-dumper": "^4.2 || ^5.0",
25-
"mikey179/vfsstream": "^1.6"
20+
"mikey179/vfsstream": "^1.6",
21+
"phpro/grumphp": "~1.0",
22+
"phpstan/phpstan": "^1.10",
23+
"phpunit/phpunit": "^9.0",
24+
"roave/infection-static-analysis-plugin": "^1.32",
25+
"squizlabs/php_codesniffer": "^3.5",
26+
"symfony/var-dumper": "^5.0 || ^6.0",
27+
"vimeo/psalm": "^5.13"
2628
},
2729
"autoload": {
2830
"psr-4": {
@@ -38,14 +40,22 @@
3840
"check-all": [
3941
"@cs-check",
4042
"@test",
41-
"@inspect"
43+
"@inspect",
44+
"@psalm",
45+
"@infection"
4246
],
4347
"cs-check": "phpcs src --colors",
4448
"cs-fix": "phpcbf src --colors",
4549
"inspect": "phpstan analyse src -l7 --ansi",
50+
"psalm": "psalm",
51+
"infection": "XDEBUG_MODE=coverage roave-infection-static-analysis-plugin",
4652
"test": "phpunit --colors=always"
4753
},
4854
"config": {
49-
"sort-packages": true
55+
"sort-packages": true,
56+
"allow-plugins": {
57+
"phpro/grumphp": true,
58+
"infection/extension-installer": true
59+
}
5060
}
5161
}

infection.json.dist

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"source": {
3+
"directories": [
4+
"src"
5+
]
6+
},
7+
"logs": {
8+
"text": "infection.log"
9+
},
10+
"mutators": {
11+
"@default": true
12+
}
13+
}

psalm.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="3"
4+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5+
xmlns="https://getpsalm.org/schema/config"
6+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
7+
>
8+
<projectFiles>
9+
<directory name="src" />
10+
<ignoreFiles>
11+
<directory name="vendor" />
12+
</ignoreFiles>
13+
</projectFiles>
14+
15+
<issueHandlers>
16+
<LessSpecificReturnType errorLevel="info" />
17+
18+
<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->
19+
20+
<DeprecatedMethod errorLevel="info" />
21+
<DeprecatedProperty errorLevel="info" />
22+
<DeprecatedClass errorLevel="info" />
23+
<DeprecatedConstant errorLevel="info" />
24+
<DeprecatedInterface errorLevel="info" />
25+
<DeprecatedTrait errorLevel="info" />
26+
27+
<InternalMethod errorLevel="info" />
28+
<InternalProperty errorLevel="info" />
29+
<InternalClass errorLevel="info" />
30+
31+
<MissingClosureReturnType errorLevel="info" />
32+
<MissingReturnType errorLevel="info" />
33+
<MissingPropertyType errorLevel="info" />
34+
<InvalidDocblock errorLevel="info" />
35+
36+
<PropertyNotSetInConstructor errorLevel="info" />
37+
<MissingConstructor errorLevel="info" />
38+
<MissingClosureParamType errorLevel="info" />
39+
<MissingParamType errorLevel="info" />
40+
41+
<RedundantCondition errorLevel="info" />
42+
43+
<DocblockTypeContradiction errorLevel="info" />
44+
<RedundantConditionGivenDocblockType errorLevel="info" />
45+
46+
<UnresolvableInclude errorLevel="info" />
47+
48+
<RawObjectIteration errorLevel="info" />
49+
50+
<InvalidStringClass errorLevel="info" />
51+
</issueHandlers>
52+
</psalm>

src/Application/Command/AbstractMakerCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Antidot\DevTools\Application\Service\GetNamespaceFromFQCN;
1010
use Antidot\DevTools\Application\Service\GetRealPathFromNamespace;
1111
use Symfony\Component\Console\Command\Command;
12+
use Symfony\Component\Console\Helper\QuestionHelper;
1213
use Symfony\Component\Console\Input\InputArgument;
1314
use Symfony\Component\Console\Input\InputInterface;
1415
use Symfony\Component\Console\Output\OutputInterface;
@@ -107,6 +108,7 @@ protected function getFQCN(InputInterface $input, OutputInterface $output): stri
107108
{
108109
$fqcn = $input->getArgument('fqcn');
109110
if (null === $fqcn) {
111+
/** @var QuestionHelper $questionHelper */
110112
$questionHelper = $this->getHelper('question');
111113
$question = new Question(
112114
static::QUESTION,

0 commit comments

Comments
 (0)