noitran /
cs-fixer-command
| 1 | <?php |
||||||
| 2 | |||||||
| 3 | namespace Noitran\CsFixer; |
||||||
| 4 | |||||||
| 5 | use Illuminate\Support\ServiceProvider; |
||||||
| 6 | use Noitran\CsFixer\Console\PhpCsCommand; |
||||||
| 7 | use Noitran\CsFixer\Console\HookSetupCommand; |
||||||
| 8 | use Laravel\Lumen\Application as LumenApplication; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 9 | use Illuminate\Foundation\Application as LaravelApplication; |
||||||
| 10 | |||||||
| 11 | /** |
||||||
| 12 | * Class CsFixerServiceProvider |
||||||
| 13 | */ |
||||||
| 14 | class CsFixerServiceProvider extends ServiceProvider |
||||||
| 15 | { |
||||||
| 16 | /** |
||||||
| 17 | * Bootstrap the application services. |
||||||
| 18 | */ |
||||||
| 19 | 1 | public function boot(): void |
|||||
| 20 | { |
||||||
| 21 | // |
||||||
| 22 | 1 | } |
|||||
| 23 | |||||||
| 24 | /** |
||||||
| 25 | * Register the application services. |
||||||
| 26 | */ |
||||||
| 27 | 1 | public function register(): void |
|||||
| 28 | { |
||||||
| 29 | 1 | $this->setupConfig(); |
|||||
| 30 | |||||||
| 31 | $this->app->singleton('command.phpcs.fix', function () { |
||||||
| 32 | 1 | return new PhpCsCommand(); |
|||||
| 33 | 1 | }); |
|||||
| 34 | |||||||
| 35 | $this->app->singleton('command.phpcs.install-hook', function () { |
||||||
| 36 | 1 | return new HookSetupCommand(); |
|||||
| 37 | 1 | }); |
|||||
| 38 | |||||||
| 39 | 1 | $this->commands('command.phpcs.fix'); |
|||||
| 40 | 1 | $this->commands('command.phpcs.install-hook'); |
|||||
| 41 | 1 | } |
|||||
| 42 | |||||||
| 43 | /** |
||||||
| 44 | * @return void |
||||||
| 45 | */ |
||||||
| 46 | 1 | protected function setupConfig(): void |
|||||
| 47 | { |
||||||
| 48 | 1 | $source = \dirname(__DIR__) . '/config/phpcs.php'; |
|||||
| 49 | 1 | if ($this->app instanceof LaravelApplication) { |
|||||
| 50 | 1 | $this->publishes([$source => config_path('phpcs.php')]); |
|||||
| 51 | } elseif ($this->app instanceof LumenApplication) { |
||||||
| 52 | $this->app->configure('phpcs'); |
||||||
|
0 ignored issues
–
show
The method
configure() does not exist on Illuminate\Contracts\Foundation\Application.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces. This is most likely a typographical error or the method has been renamed. Loading history...
|
|||||||
| 53 | } |
||||||
| 54 | 1 | $this->mergeConfigFrom($source, 'phpcs'); |
|||||
| 55 | 1 | } |
|||||
| 56 | } |
||||||
| 57 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths