diff --git a/src/Handler.php b/src/Handler.php index c0b889d6e0c034fd47fd22f9aa5efa5b8d78a031..7f1f1336e0bbdb1fb96182fbaf62a013ea59098b 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -79,10 +79,27 @@ class Handler { $scriptDescriptions[$name] = $script['description']; } } + foreach ($this->defaults() as $key => $default) { + $scripts[$key] = $default['script']; + $scriptDescriptions[$key] = $default['description']; + } $settings->setSection('scripts', $scripts); $settings->setSubSection('extra', 'scripts-description', $scriptDescriptions); $settings->write(); } + /** + * Provides an array of default scripts for Drupal projects. + * + * @return array + */ + protected function defaults() { + return [ + 'phpcs' => [ + 'script' => 'phpcs --standard=DrupalPractice web/modules/custom/ web/profiles/custom/ web/themes/custom/', + 'description' => 'Run PHP Code Sniffer on custom code', + ], + ]; + } }