Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chiiya committed Jun 19, 2023
1 parent baf78b9 commit 5f48705
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 127 deletions.
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
],
"require": {
"php": "^8.1",
"chiiya/code-style-php": "^2.12",
"chiiya/code-style-php": "^2.13",
"illuminate/contracts": "^9.0|^10.0",
"nunomaduro/larastan": "^2.4",
"phpro/grumphp": "^1.15",
"nunomaduro/larastan": "^2.6",
"phpro/grumphp": "^2.0",
"spatie/laravel-package-tools": "^1.14",
"tightenco/tlint": "^8.0"
},
Expand Down
15 changes: 2 additions & 13 deletions src/GrumPHPExtensionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@
namespace Chiiya\LaravelCodeStyle;

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

class GrumPHPExtensionLoader implements ExtensionInterface
{
public function load(ContainerBuilder $container): void
public function imports(): iterable
{
$container
->register('task.tlint', TLintTask::class)
->addArgument(new Reference('process_builder'))
->addArgument(new Reference('formatter.raw_process'))
->addTag('grumphp.task', ['task' => 'tlint']);
$container
->register('task.rector', RectorTask::class)
->addArgument(new Reference('process_builder'))
->addArgument(new Reference('formatter.raw_process'))
->addTag('grumphp.task', ['task' => 'rector']);
yield __DIR__.'/extensions.yaml';
}
}
109 changes: 0 additions & 109 deletions src/RectorTask.php

This file was deleted.

7 changes: 5 additions & 2 deletions src/TLintTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
use GrumPHP\Runner\TaskResult;
use GrumPHP\Runner\TaskResultInterface;
use GrumPHP\Task\AbstractExternalTask;
use GrumPHP\Task\Config\ConfigOptionsResolver;
use GrumPHP\Task\Context\ContextInterface;
use GrumPHP\Task\Context\GitPreCommitContext;
use GrumPHP\Task\Context\RunContext;
use Symfony\Component\OptionsResolver\OptionsResolver;

class TLintTask extends AbstractExternalTask
{
public static function getConfigurableOptions(): OptionsResolver
public static function getConfigurableOptions(): ConfigOptionsResolver
{
$resolver = new OptionsResolver;
$resolver->setDefaults([
Expand All @@ -23,7 +24,9 @@ public static function getConfigurableOptions(): OptionsResolver
$resolver->addAllowedTypes('triggered_by', ['array']);
$resolver->addAllowedTypes('diff', ['bool']);

return $resolver;
return ConfigOptionsResolver::fromClosure(
static fn (array $options): array => $resolver->resolve($options),
);
}

public function canRunInContext(ContextInterface $context): bool
Expand Down
8 changes: 8 additions & 0 deletions src/extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
Chiiya\LaravelCodeStyle\TLintTask:
class: Chiiya\LaravelCodeStyle\TLintTask
arguments:
- '@process_builder'
- '@formatter.raw_process'
tags:
- {name: grumphp.task, task: tlint}

0 comments on commit 5f48705

Please sign in to comment.