Skip to content

Commit eb64bc1

Browse files
committed
Merge branch 'master' into 4.x
2 parents b82e30c + 8673f6a commit eb64bc1

File tree

2 files changed

+47
-45
lines changed

2 files changed

+47
-45
lines changed

src/Config.php

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

1076-
$this->basepath = Common::realpath(substr($arg, 9));
1076+
$basepath = Common::realpath(substr($arg, 9));
10771077

10781078
// It may not exist and return false instead.
1079-
if ($this->basepath === false) {
1079+
if ($basepath === false) {
10801080
$this->basepath = substr($arg, 9);
1081+
} else {
1082+
$this->basepath = $basepath;
10811083
}
10821084

10831085
if (is_dir($this->basepath) === false) {

src/Util/Common.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public static function realpath($path)
144144
/**
145145
* Removes a base path from the front of a file path.
146146
*
147-
* @param string $path The path of the file.
148-
* @param string $basepath The base path to remove. This should not end
149-
* with a directory separator.
147+
* @param string $path The path of the file.
148+
* @param string|null $basepath The base path to remove. This should not end
149+
* with a directory separator.
150150
*
151151
* @return string
152152
*/

0 commit comments

Comments
 (0)