Skip to content

Commit a7d32c8

Browse files
author
Stefan Boonstra
committed
WIP
1 parent 8c38b9a commit a7d32c8

6 files changed

Lines changed: 28 additions & 29 deletions

File tree

.github/workflows/testing-suite.yml

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,28 @@ jobs:
44
PHP:
55
strategy:
66
matrix:
7-
image: [
8-
'srcoder/development-php:php81-fpm',
9-
'srcoder/development-php:php82-fpm'
10-
]
7+
php-version: [8.1, 8.2, 8.3, 8.4]
118
runs-on: ubuntu-latest
129
container:
13-
image: ${{ matrix.image }}
10+
image: ${{ matrix.php-version == '8.1' && 'srcoder/development-php:php81-fpm' ||
11+
matrix.php-version == '8.2' && 'srcoder/development-php:php82-fpm' ||
12+
matrix.php-version == '8.3' && 'srcoder/development-php:php83-fpm' ||
13+
matrix.php-version == '8.4' && 'srcoder/development-php:php84-fpm' }}
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v2
17-
- name: Testing Suite
18-
# We are purposefully skipping the phpunit task since it is written for phpunit ^12 and php >= 8.3
17+
18+
- name: Install Dependencies
1919
run: |
2020
composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
2121
composer2 show
22-
composer2 exec -v grumphp -- run --tasks=composer,jsonlint,xmllint,yamllint,phpcs,phplint,phpmd,phpstan,securitychecker_enlightn
2322
shell: bash
24-
PHPWithUnitTests:
25-
runs-on: ubuntu-latest
26-
container:
27-
image: 'srcoder/development-php:php83-fpm'
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v2
31-
- name: Testing Suite
23+
24+
- name: Run GrumPHP Tasks
3225
run: |
33-
composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
34-
composer2 show
35-
composer2 exec -v grumphp -- run --tasks=composer,jsonlint,xmllint,yamllint,phpcs,phplint,phpmd,phpstan,phpunit,securitychecker_enlightn
26+
if [[ "${{ matrix.php-version }}" == "8.1" || "${{ matrix.php-version }}" == "8.2" ]]; then
27+
composer2 exec -v grumphp -- run --tasks=composer,jsonlint,xmllint,yamllint,phpcs,phplint,phpmd,phpstan,securitychecker_enlightn
28+
else
29+
composer2 exec -v grumphp -- run
30+
fi
3631
shell: bash

src/ConfigResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ class ConfigResolver
2121
* Constructor.
2222
*
2323
* @param ProjectTypeResolver $typeResolver
24-
* @param string $template
24+
* @param string|null $template
2525
*/
2626
public function __construct(
2727
ProjectTypeResolver $typeResolver,
28-
string $template = null
28+
?string $template = null
2929
) {
3030
$this->typeResolver = $typeResolver;
3131
$this->template = $template ?? $this->template;

src/Installer/ArchiveExcludeInstaller.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Composer\Factory;
1313
use Composer\IO\IOInterface;
1414
use Composer\Json\JsonFile;
15+
use Exception;
16+
use Seld\JsonLint\ParsingException;
1517
use Youwe\FileMapping\FileMappingInterface;
1618
use Youwe\TestingSuite\Composer\MappingResolver;
1719

@@ -50,15 +52,15 @@ class ArchiveExcludeInstaller implements InstallerInterface
5052
* @param MappingResolver $resolver
5153
* @param IOInterface $io
5254
* @param JsonFile|null $file
53-
* @param string $destination
55+
* @param string |null $destination
5456
* @param array|null $defaults
5557
*/
5658
public function __construct(
5759
MappingResolver $resolver,
5860
IOInterface $io,
59-
JsonFile $file = null,
60-
string $destination = null,
61-
array $defaults = null
61+
?JsonFile $file = null,
62+
?string $destination = null,
63+
?array $defaults = null
6264
) {
6365
$this->resolver = $resolver;
6466
$this->io = $io;
@@ -71,6 +73,7 @@ public function __construct(
7173
* Install.
7274
*
7375
* @return void
76+
* @throws Exception
7477
*/
7578
public function install(): void
7679
{

src/Installer/ConfigInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ConfigInstaller implements InstallerInterface
3434
*/
3535
public function __construct(
3636
ConfigResolver $resolver,
37-
JsonFile $file = null
37+
?JsonFile $file = null
3838
) {
3939
$this->resolver = $resolver;
4040
$this->file = $file ?? new JsonFile(Factory::getComposerFile());

src/Installer/PackagesInstaller.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ public function __construct(
9393
Composer $composer,
9494
ProjectTypeResolver $typeResolver,
9595
IOInterface $io,
96-
DependencyInstaller $installer = null,
97-
array $mapping = null
96+
?DependencyInstaller $installer = null,
97+
?array $mapping = null
9898
) {
9999
$this->composer = $composer;
100100
$this->typeResolver = $typeResolver;
@@ -135,6 +135,7 @@ public function install(): void
135135
* Whether a package has been required.
136136
*
137137
* @param string $packageName
138+
* @param string $version
138139
*
139140
* @return bool
140141
*/

src/ProjectTypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class ProjectTypeResolver
5151
* @param Composer $composer
5252
* @param array|null $mapping
5353
*/
54-
public function __construct(Composer $composer, array $mapping = null)
54+
public function __construct(Composer $composer, ?array $mapping = null)
5555
{
5656
$this->composer = $composer;
5757
$this->mapping = $mapping ?? $this->mapping;

0 commit comments

Comments
 (0)