Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "getConfig" method to make it easier to extends #3697

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/Runner.php
Expand Up @@ -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();
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*
Expand Down