From bcc77166115cfb61d625a410eca46d3d15d3c314 Mon Sep 17 00:00:00 2001 From: Fabien Salathe Date: Wed, 19 Oct 2022 11:58:49 +0200 Subject: [PATCH] Add a "getConfig" method to make it easier to extends --- src/Runner.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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. *