diff --git a/src/Runner.php b/src/Runner.php index e0cbca7160..ebf5e4a01d 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -66,7 +66,7 @@ public function runPHPCS() // Creating the Config object populates it with all required settings // based on the CLI arguments provided to the script and any config // values the user has set. - $this->config = new Config(); + $this->config = $this->getConfig(); // Init the run and load the rulesets to set additional config vars. $this->init(); @@ -168,7 +168,7 @@ public function runPHPCBF() // Creating the Config object populates it with all required settings // based on the CLI arguments provided to the script and any config // values the user has set. - $this->config = new Config(); + $this->config = $this->getConfig(); // When processing STDIN, we can't output anything to the screen // or it will end up mixed in with the file output. @@ -895,6 +895,17 @@ public function printProgress(File $file, $numFiles, $numProcessed) }//end printProgress() + /** + * Get configuration. + * + * @return Config + */ + protected function getConfig() + { + return new Config(); + }//end getConfig() + + /** * Registers a PHP shutdown function to provide a more informative out of memory error. *