Skip to content

Commit

Permalink
Renamed PhpstanCheckDeprecationTask to PhpStanTask
Browse files Browse the repository at this point in the history
  • Loading branch information
mitrpaka committed Dec 8, 2020
1 parent 61a3db6 commit 50df22c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This repository currently has following checks:
* Cognitive complexity and other ecs sniffs - [ecs](src/Task/Ecs/README.md)
* Yaml syntax - [yaml_lint](src/Task/YamlLint/README.md)
* Json syntax - [json_lint](src/Task/JsonLint/README.md)
* Deprecation testing - [phpstan_check_deprecation](src/Task/PhpstanCheckDeprecation/README.md)
* Deprecation testing - [php_stan](src/Task/PhpStan/README.md)

## Pre-requisites

Expand Down
4 changes: 2 additions & 2 deletions config/grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grumphp:
check_file_permissions: ~
php_check_syntax: ~
phpcs: ~
phpstan_check_deprecation: ~
php_stan: ~
ecs: ~
yaml_lint: ~
json_lint: ~
Expand All @@ -18,6 +18,6 @@ grumphp:
- Wunderio\GrumPHP\Task\CheckFilePermissions\CheckFilePermissionsExtensionLoader
- Wunderio\GrumPHP\Task\Ecs\EcsExtensionLoader
- Wunderio\GrumPHP\Task\Phpcs\PhpcsExtensionLoader
- Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationExtensionLoader
- Wunderio\GrumPHP\Task\PhpStan\PhpStanExtensionLoader
- Wunderio\GrumPHP\Task\YamlLint\YamlLintExtensionLoader
- Wunderio\GrumPHP\Task\JsonLint\JsonLintExtensionLoader
4 changes: 2 additions & 2 deletions grumphp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ grumphp:
run_on: ['src', 'tests']
phpcs:
run_on: ['src', 'tests']
phpstan_check_deprecation:
php_stan:
run_on: ['src']
configuration: phpstan.neon
ecs:
Expand All @@ -23,6 +23,6 @@ grumphp:
- Wunderio\GrumPHP\Task\CheckFilePermissions\CheckFilePermissionsExtensionLoader
- Wunderio\GrumPHP\Task\Ecs\EcsExtensionLoader
- Wunderio\GrumPHP\Task\Phpcs\PhpcsExtensionLoader
- Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationExtensionLoader
- Wunderio\GrumPHP\Task\PhpStan\PhpStanExtensionLoader
- Wunderio\GrumPHP\Task\YamlLint\YamlLintExtensionLoader
- Wunderio\GrumPHP\Task\JsonLint\JsonLintExtensionLoader
14 changes: 14 additions & 0 deletions src/Task/PhpStan/PhpStanExtensionLoader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace Wunderio\GrumPHP\Task\PhpStan;

use Wunderio\GrumPHP\Task\AbstractExternalExtensionLoader;

/**
* Class PhpStan.
*
* Register PhpStan task in the service container of GrumPHP.
*
* @package Wunderio\GrumPHP\Task
*/
class PhpStanExtensionLoader extends AbstractExternalExtensionLoader {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types = 1);

namespace Wunderio\GrumPHP\Task\PhpstanCheckDeprecation;
namespace Wunderio\GrumPHP\Task\PhpStan;

use GrumPHP\Collection\ProcessArgumentsCollection;
use Wunderio\GrumPHP\Task\AbstractMultiPathProcessingTask;
Expand All @@ -14,7 +14,7 @@
*
* @package Wunderio\GrumPHP\Task
*/
class PhpstanCheckDeprecationTask extends AbstractMultiPathProcessingTask {
class PhpStanTask extends AbstractMultiPathProcessingTask {

/**
* {@inheritdoc}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# phpstan_check_deprecation
# phpstan

Check Drupal code against deprecation rules.

### grumphp.yml (with current defaults):
````yml
parameters:
tasks:
phpstan_check_deprecation:
php_stan:
ignore_patterns:
- '/vendor/'
- '/node_modules/'
Expand All @@ -27,5 +27,5 @@ parameters:
defaults: ~
allowed_types: ['string', 'null']
extensions:
- Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationExtensionLoader
- Wunderio\GrumPHP\Task\PhpStan\PhpStanExtensionLoader
````

This file was deleted.

2 changes: 1 addition & 1 deletion src/Task/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ Wunderio\GrumPHP\Task\Phpcs\PhpcsTask:
basepath:
defaults: '.'
allowed_types: ['string']
Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationTask:
Wunderio\GrumPHP\Task\PhpStan\PhpStanTask:
options:
ignore_patterns:
defaults:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
use GrumPHP\Task\Config\TaskConfigInterface;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Yaml\Yaml;
use Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationTask;
use Wunderio\GrumPHP\Task\PhpStan\PhpStanTask;

/**
* Class PhpstanCheckDeprecationTaskTest.
* Class PhpStanTaskTest.
*
* Tests covering PhpstanCheckDeprecation task.
* Tests covering PhpStan task.
*/
final class PhpstanCheckDeprecationTaskTest extends TestCase {
final class PhpStanTaskTest extends TestCase {

/**
* Test building arguments.
*
* @covers \Wunderio\GrumPHP\Task\PhpstanCheckDeprecation\PhpstanCheckDeprecationTask::buildArguments
* @covers \Wunderio\GrumPHP\Task\PhpStan\PhpStanTask::buildArguments
*/
public function testBuildsProcessArguments(): void {
$processBuilder = $this->createMock(ProcessBuilder::class);
$stub = $this->getMockBuilder(PhpstanCheckDeprecationTask::class)->setConstructorArgs([
$stub = $this->getMockBuilder(PhpStanTask::class)->setConstructorArgs([
$processBuilder,
$this->createMock(ProcessFormatterInterface::class),
])
Expand Down Expand Up @@ -62,7 +62,7 @@ public function testBuildsProcessArguments(): void {
*/
protected function getConfigurations(): array {
$tasks = Yaml::parseFile(__DIR__ . '/../../src/Task/tasks.yml');
return $tasks[PhpstanCheckDeprecationTask::class]['options'];
return $tasks[PhpStanTask::class]['options'];
}

}

0 comments on commit 50df22c

Please sign in to comment.