function Config::processFilePath
Processes a file path and add it to the file list.
Parameters
string $path The path to the file to add.:
Return value
void
Throws
\PHP_CodeSniffer\Exceptions\DeepExitException
2 calls to Config::processFilePath()
- Config::processLongArgument in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Processes a long (--example) command-line argument.
- Config::processUnknownArgument in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Processes an unknown command line argument.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Config.php, line 1317
Class
- Config
- Stores the configuration used to run PHPCS and PHPCBF.
Namespace
PHP_CodeSnifferCode
public function processFilePath($path) {
// If we are processing STDIN, don't record any files to check.
if ($this->stdin === true) {
return;
}
$file = Common::realpath($path);
if (file_exists($file) === false) {
if ($this->dieOnUnknownArg === false) {
return;
}
$error = 'ERROR: The file "' . $path . '" does not exist.' . PHP_EOL . PHP_EOL;
$error .= $this->printShortUsage(true);
throw new DeepExitException($error, 3);
}
else {
// Can't modify the files array directly because it's not a real
// class member, so need to use this little get/modify/set trick.
$files = $this->files;
$files[] = $file;
$this->files = $files;
self::$overriddenDefaults['files'] = true;
}
}