Skip to content

Commit 88719f3

Browse files
authored
Merge pull request #16 from pluswerk/feature/grumphp-2
2 parents 5c16664 + bf5efb5 commit 88719f3

6 files changed

Lines changed: 41 additions & 55 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Run grumphp with different versions
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
php:
10+
- '8.1'
11+
- '8.2'
12+
container:
13+
image: kanti/buildy:${{ matrix.php }}
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: composer install --no-progress --no-scripts -n
17+
- run: ./vendor/bin/grumphp run

.travis.yml

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

Services.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
PLUS\GrumPHPBomTask\BomFixerTask:
3+
class: PLUS\GrumPHPBomTask\BomFixerTask
4+
arguments:
5+
- '@process_builder'
6+
- '@formatter.raw_process'
7+
tags:
8+
- {name: grumphp.task, task: plus_bom_fixer}

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@
66
"authors": [
77
{
88
"name": "Matthias Vogel",
9-
"email": "matthias.vogel@pluswerk.ag",
10-
"homepage": "http://pluswerk.ag"
9+
"email": "m.vogel@andersundsehr.com",
10+
"homepage": "https://www.andersundsehr.com"
1111
}
1212
],
13-
"config": {
14-
"platform": {
15-
"php": "7.3"
16-
}
17-
},
1813
"support": {
1914
"issues": "https://github.com/pluswerk/grumphp-bom-task/issues"
2015
},
@@ -25,11 +20,16 @@
2520
}
2621
},
2722
"require": {
28-
"php": ">=7.3",
29-
"phpro/grumphp": "^1.3.3",
23+
"php": "~8.1.0 || ~8.2.0",
24+
"phpro/grumphp": "^2",
3025
"opis/closure": "^3.6.2"
3126
},
3227
"require-dev": {
3328
"squizlabs/php_codesniffer": ">=3.5.0 <4.0.0"
29+
},
30+
"config": {
31+
"allow-plugins": {
32+
"phpro/grumphp": true
33+
}
3434
}
3535
}

src/BomFixerTask.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use GrumPHP\Runner\TaskResult;
66
use GrumPHP\Runner\TaskResultInterface;
7+
use GrumPHP\Task\Config\ConfigOptionsResolver;
78
use GrumPHP\Task\Config\EmptyTaskConfig;
89
use GrumPHP\Task\Config\TaskConfigInterface;
910
use GrumPHP\Task\Context\ContextInterface;
@@ -22,7 +23,7 @@ public function __construct()
2223
$this->config = new EmptyTaskConfig();
2324
}
2425

25-
public static function getConfigurableOptions(): OptionsResolver
26+
public static function getConfigurableOptions(): ConfigOptionsResolver
2627
{
2728
$resolver = new OptionsResolver();
2829
$resolver->setDefaults(
@@ -32,8 +33,7 @@ public static function getConfigurableOptions(): OptionsResolver
3233
);
3334

3435
$resolver->addAllowedTypes('triggered_by', ['array']);
35-
36-
return $resolver;
36+
return ConfigOptionsResolver::fromOptionsResolver($resolver);
3737
}
3838

3939
public function getConfig(): TaskConfigInterface

src/ExtensionLoader.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PLUS\GrumPHPBomTask;
46

57
use GrumPHP\Extension\ExtensionInterface;
6-
use Symfony\Component\DependencyInjection\ContainerBuilder;
7-
use Symfony\Component\DependencyInjection\Reference;
88

99
class ExtensionLoader implements ExtensionInterface
1010
{
11-
public function load(ContainerBuilder $container): void
11+
public function imports(): iterable
1212
{
13-
$container->register('task.plus_bom_fixer', BomFixerTask::class)
14-
->addArgument(new Reference('process_builder'))
15-
->addArgument(new Reference('formatter.raw_process'))
16-
->addTag('grumphp.task', ['task' => 'plus_bom_fixer']);
13+
yield __DIR__ . '/../Services.yaml';
1714
}
1815
}

0 commit comments

Comments
 (0)