|
23 | 23 | /**
|
24 | 24 | * Stores the configuration used to run PHPCS and PHPCBF.
|
25 | 25 | *
|
26 |
| - * @property string[] $files The files and directories to check. |
27 |
| - * @property string[] $standards The standards being used for checking. |
28 |
| - * @property int $verbosity How verbose the output should be. |
29 |
| - * 0: no unnecessary output |
30 |
| - * 1: basic output for files being checked |
31 |
| - * 2: ruleset and file parsing output |
32 |
| - * 3: sniff execution output |
33 |
| - * @property bool $interactive Enable interactive checking mode. |
34 |
| - * @property int $parallel Check files in parallel. |
35 |
| - * @property bool $cache Enable the use of the file cache. |
36 |
| - * @property string $cacheFile Path to the file where the cache data should be written |
37 |
| - * @property bool $colors Display colours in output. |
38 |
| - * @property bool $explain Explain the coding standards. |
39 |
| - * @property bool $local Process local files in directories only (no recursion). |
40 |
| - * @property bool $showSources Show sniff source codes in report output. |
41 |
| - * @property bool $showProgress Show basic progress information while running. |
42 |
| - * @property bool $quiet Quiet mode; disables progress and verbose output. |
43 |
| - * @property bool $annotations Process phpcs: annotations. |
44 |
| - * @property int $tabWidth How many spaces each tab is worth. |
45 |
| - * @property string $encoding The encoding of the files being checked. |
46 |
| - * @property string[] $sniffs The sniffs that should be used for checking. |
47 |
| - * If empty, all sniffs in the supplied standards will be used. |
48 |
| - * @property string[] $exclude The sniffs that should be excluded from checking. |
49 |
| - * If empty, all sniffs in the supplied standards will be used. |
50 |
| - * @property string[] $ignored Regular expressions used to ignore files and folders during checking. |
51 |
| - * @property string $reportFile A file where the report output should be written. |
52 |
| - * @property string $generator The documentation generator to use. |
53 |
| - * @property string $filter The filter to use for the run. |
54 |
| - * @property string[] $bootstrap One of more files to include before the run begins. |
55 |
| - * @property int|string $reportWidth The maximum number of columns that reports should use for output. |
56 |
| - * Set to "auto" for have this value changed to the width of the terminal. |
57 |
| - * @property int $errorSeverity The minimum severity an error must have to be displayed. |
58 |
| - * @property int $warningSeverity The minimum severity a warning must have to be displayed. |
59 |
| - * @property bool $recordErrors Record the content of error messages as well as error counts. |
60 |
| - * @property string $suffix A suffix to add to fixed files. |
61 |
| - * @property string $basepath A file system location to strip from the paths of files shown in reports. |
62 |
| - * @property bool $stdin Read content from STDIN instead of supplied files. |
63 |
| - * @property string $stdinContent Content passed directly to PHPCS on STDIN. |
64 |
| - * @property string $stdinPath The path to use for content passed on STDIN. |
65 |
| - * @property bool $trackTime Whether or not to track sniff run time. |
| 26 | + * @property string[] $files The files and directories to check. |
| 27 | + * @property string[] $standards The standards being used for checking. |
| 28 | + * @property int $verbosity How verbose the output should be. |
| 29 | + * 0: no unnecessary output |
| 30 | + * 1: basic output for files being checked |
| 31 | + * 2: ruleset and file parsing output |
| 32 | + * 3: sniff execution output |
| 33 | + * @property bool $interactive Enable interactive checking mode. |
| 34 | + * @property int $parallel Check files in parallel. |
| 35 | + * @property bool $cache Enable the use of the file cache. |
| 36 | + * @property string $cacheFile Path to the file where the cache data should be written |
| 37 | + * @property bool $colors Display colours in output. |
| 38 | + * @property bool $explain Explain the coding standards. |
| 39 | + * @property bool $local Process local files in directories only (no recursion). |
| 40 | + * @property bool $showSources Show sniff source codes in report output. |
| 41 | + * @property bool $showProgress Show basic progress information while running. |
| 42 | + * @property bool $quiet Quiet mode; disables progress and verbose output. |
| 43 | + * @property bool $annotations Process phpcs: annotations. |
| 44 | + * @property int $tabWidth How many spaces each tab is worth. |
| 45 | + * @property string $encoding The encoding of the files being checked. |
| 46 | + * @property string[] $sniffs The sniffs that should be used for checking. |
| 47 | + * If empty, all sniffs in the supplied standards will be used. |
| 48 | + * @property string[] $exclude The sniffs that should be excluded from checking. |
| 49 | + * If empty, all sniffs in the supplied standards will be used. |
| 50 | + * @property string[] $ignored Regular expressions used to ignore files and folders during checking. |
| 51 | + * @property string $reportFile A file where the report output should be written. |
| 52 | + * @property string $generator The documentation generator to use. |
| 53 | + * @property string $filter The filter to use for the run. |
| 54 | + * @property string[] $bootstrap One of more files to include before the run begins. |
| 55 | + * @property int|string $reportWidth The maximum number of columns that reports should use for output. |
| 56 | + * Set to "auto" for have this value changed to the width of the terminal. |
| 57 | + * @property int $errorSeverity The minimum severity an error must have to be displayed. |
| 58 | + * @property int $warningSeverity The minimum severity a warning must have to be displayed. |
| 59 | + * @property bool $recordErrors Record the content of error messages as well as error counts. |
| 60 | + * @property string $suffix A suffix to add to fixed files. |
| 61 | + * @property string|null $basepath A file system location to strip from the paths of files shown in reports. |
| 62 | + * @property bool $stdin Read content from STDIN instead of supplied files. |
| 63 | + * @property string $stdinContent Content passed directly to PHPCS on STDIN. |
| 64 | + * @property string $stdinPath The path to use for content passed on STDIN. |
| 65 | + * @property bool $trackTime Whether or not to track sniff run time. |
66 | 66 | *
|
67 | 67 | * @property array<string, string> $extensions File extensions that should be checked, and what tokenizer to use.
|
68 | 68 | * E.g., array('inc' => 'PHP');
|
@@ -1057,11 +1057,13 @@ public function processLongArgument($arg, $pos)
|
1057 | 1057 | break;
|
1058 | 1058 | }
|
1059 | 1059 |
|
1060 |
| - $this->basepath = Common::realpath(substr($arg, 9)); |
| 1060 | + $basepath = Common::realpath(substr($arg, 9)); |
1061 | 1061 |
|
1062 | 1062 | // It may not exist and return false instead.
|
1063 |
| - if ($this->basepath === false) { |
| 1063 | + if ($basepath === false) { |
1064 | 1064 | $this->basepath = substr($arg, 9);
|
| 1065 | + } else { |
| 1066 | + $this->basepath = $basepath; |
1065 | 1067 | }
|
1066 | 1068 |
|
1067 | 1069 | if (is_dir($this->basepath) === false) {
|
|
0 commit comments