Skip to content

Commit

Permalink
Merge pull request #16 from pluswerk/feature/grumphp-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti authored Jul 31, 2023
2 parents 5c16664 + bf5efb5 commit 88719f3
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 55 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/run-grumphp-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Run grumphp with different versions
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
container:
image: kanti/buildy:${{ matrix.php }}
steps:
- uses: actions/checkout@v2
- run: composer install --no-progress --no-scripts -n
- run: ./vendor/bin/grumphp run
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions Services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
PLUS\GrumPHPBomTask\BomFixerTask:
class: PLUS\GrumPHPBomTask\BomFixerTask
arguments:
- '@process_builder'
- '@formatter.raw_process'
tags:
- {name: grumphp.task, task: plus_bom_fixer}
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
"authors": [
{
"name": "Matthias Vogel",
"email": "matthias.vogel@pluswerk.ag",
"homepage": "http://pluswerk.ag"
"email": "m.vogel@andersundsehr.com",
"homepage": "https://www.andersundsehr.com"
}
],
"config": {
"platform": {
"php": "7.3"
}
},
"support": {
"issues": "https://github.com/pluswerk/grumphp-bom-task/issues"
},
Expand All @@ -25,11 +20,16 @@
}
},
"require": {
"php": ">=7.3",
"phpro/grumphp": "^1.3.3",
"php": "~8.1.0 || ~8.2.0",
"phpro/grumphp": "^2",
"opis/closure": "^3.6.2"
},
"require-dev": {
"squizlabs/php_codesniffer": ">=3.5.0 <4.0.0"
},
"config": {
"allow-plugins": {
"phpro/grumphp": true
}
}
}
6 changes: 3 additions & 3 deletions src/BomFixerTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use GrumPHP\Runner\TaskResult;
use GrumPHP\Runner\TaskResultInterface;
use GrumPHP\Task\Config\ConfigOptionsResolver;
use GrumPHP\Task\Config\EmptyTaskConfig;
use GrumPHP\Task\Config\TaskConfigInterface;
use GrumPHP\Task\Context\ContextInterface;
Expand All @@ -22,7 +23,7 @@ public function __construct()
$this->config = new EmptyTaskConfig();
}

public static function getConfigurableOptions(): OptionsResolver
public static function getConfigurableOptions(): ConfigOptionsResolver
{
$resolver = new OptionsResolver();
$resolver->setDefaults(
Expand All @@ -32,8 +33,7 @@ public static function getConfigurableOptions(): OptionsResolver
);

$resolver->addAllowedTypes('triggered_by', ['array']);

return $resolver;
return ConfigOptionsResolver::fromOptionsResolver($resolver);
}

public function getConfig(): TaskConfigInterface
Expand Down
11 changes: 4 additions & 7 deletions src/ExtensionLoader.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php

declare(strict_types=1);

namespace PLUS\GrumPHPBomTask;

use GrumPHP\Extension\ExtensionInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

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

0 comments on commit 88719f3

Please sign in to comment.