Skip to content
This repository was archived by the owner on Nov 23, 2020. It is now read-only.

Commit 3077588

Browse files
committed
add phpstancs arguments namespace
1 parent 4ffb066 commit 3077588

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

phpstan.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
22
"level": "max"
3-
"runCS": true
3+
phpstancs:
4+
"runCS": true
45

56
services:
67
errorFormatter.cslike:

src/StanCs.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,19 @@ class StanCs
4343
private $fileToAnalise;
4444

4545

46-
4746
/**
4847
* StanCs constructor.
4948
*
50-
* @param array $argv
49+
* @param array $argv
5150
* @param string $projectRootDir
5251
*/
5352
public function __construct(array $argv, string $projectRootDir)
5453
{
55-
$this->projectRootDir = $projectRootDir;
54+
$this->projectRootDir = $projectRootDir;
5655
$this->phpstancsRootDir = __DIR__ . '/../';
57-
$this->argv = $argv;
58-
$this->fileToAnalise = $this->argv[1];
59-
$this->config = $this->getConfig();
56+
$this->argv = $argv;
57+
$this->fileToAnalise = $this->argv[1];
58+
$this->config = $this->getConfig();
6059
}
6160

6261
public function run(): string
@@ -66,7 +65,7 @@ public function run(): string
6665
}
6766

6867
if ($this->argv[1] === '--version' || in_array('-i', $this->argv, true)) {
69-
return $this->getCsOutput();
68+
return $this->getCsOutput();
7069
}
7170

7271
if (!$this->config->runCs) {
@@ -116,7 +115,7 @@ protected function getStanOutput(): string
116115
*/
117116
protected function getCsOutput(): string
118117
{
119-
$args = $this->argv;
118+
$args = $this->argv;
120119
array_shift($args);
121120

122121
ob_start();
@@ -153,8 +152,8 @@ private function getConfig(): Config
153152

154153
if (file_exists($configFile)) {
155154
$NeonConfig = $this->decodeNeonFile($configFile);
156-
if (isset($NeonConfig['parameters']['runCS'])) {
157-
$config->runCs = (bool)$NeonConfig['parameters']['runCS'];
155+
if (isset($NeonConfig['parameters']['phpstancs']['runCS'])) {
156+
$config->runCs = (bool)$NeonConfig['parameters']['phpstancs']['runCS'];
158157
}
159158
}
160159

0 commit comments

Comments
 (0)