Browse Source

QA tooling. Remove abstract status of Builder class.

Frederic G. MARAND 3 years ago
parent
commit
9d589147f2

+ 2 - 1
.gitignore

@@ -1,5 +1,6 @@
 /.idea/
 /.phpunit.cache
 /composer.lock
-/coverage
+/coverage/*
+!/coverage/.gitkeep
 /vendor/

+ 4 - 3
composer.json

@@ -25,16 +25,17 @@
   "name": "fgm/drupal_composer_builder",
   "prefer-stable": true,
   "require": {
+    "php": "^7.4 || ^8",
     "composer-plugin-api": "^1.1",
-    "composer/installers": "^1.2"
+    "composer/installers": "^1.12"
   },
   "require-dev": {
     "composer/composer": "^1",
     "dealerdirect/phpcodesniffer-composer-installer": "dev-master",
-    "drupal/coder": "^8.3.6",
+    "drupal/coder": "^8.3.13",
     "phpstan/phpstan": "^0.12.99",
     "phpunit/phpunit": "^9.5",
-    "squizlabs/php_codesniffer": "^3.0@dev",
+    "squizlabs/php_codesniffer": "^3.6",
     "twig/twig": "^1"
   },
   "scripts": {

+ 0 - 0
coverage/.gitkeep


+ 1 - 1
src/BaseBuilderCommand.php

@@ -45,7 +45,7 @@ abstract class BaseBuilderCommand extends BaseCommand {
    * @param \Symfony\Component\Console\Output\OutputInterface $output
    *   Command output.
    * @param string $buildName
-   *   The nature of the build: services, settings, etc.
+   *   The template name as a composer.json extra section.
    *
    * @return array
    *   - string Template name

+ 10 - 0
src/BuildServicesCommand.php

@@ -30,6 +30,16 @@ class BuildServicesCommand extends BaseBuilderCommand {
    */
   protected $eventName;
 
+  /**
+   * Does this command use a template ?
+   *
+   * @return bool
+   *   Does it ?
+   */
+  protected function useTemplate() {
+    return FALSE;
+  }
+
   /**
    * Configures the current command.
    */

+ 1 - 1
src/MergeParamsCommand.php

@@ -79,7 +79,7 @@ EOT
    *
    * {@inheritDoc}
    */
-  public function execute(InputInterface $input, OutputInterface $output) {
+  public function execute(InputInterface $input, OutputInterface $output): int {
     $settingsPath = $this->getSettingsPath();
     $yaml = new Yaml();
 

+ 10 - 5
src/PhpMemcacheAdminConfigCommand.php

@@ -67,8 +67,8 @@ class PhpMemcacheAdminConfigCommand extends BaseBuilderCommand {
       ->setDescription('Build the PhpMemcacheAdmin configuration.')
       ->setDefinition(
         new InputDefinition([
-          new InputArgument(static::ARG_FILE, InputArgument::OPTIONAL, '', static::BUILD_NAME),
-        ])
+                              new InputArgument(static::ARG_FILE, InputArgument::OPTIONAL, '', static::BUILD_NAME),
+                            ])
       )
       ->setHelp(
         <<<EOT
@@ -143,9 +143,14 @@ EOT
       ->getRepositoryManager()
       ->getLocalRepository()
       ->getPackages();
-    $package = current(array_filter($packages, function (PackageInterface $package) {
-      return $package->getName() === static::PACKAGE;
-    }));
+    $package = current(
+      array_filter(
+        $packages,
+        function (PackageInterface $package) {
+          return $package->getName() === static::PACKAGE;
+        }
+      )
+    );
     $targetBase = $composer
       ->getInstallationManager()
       ->getInstallPath($package);