diff --git a/.editorconfig b/.editorconfig index 12bcb27e4ee7bbca7f74423a87d205926d2ad1d2..ccc6a281e51a2f99832b3c2d5b7b42b3ce84c36e 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,6 +12,3 @@ indent_size = 2 charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true - -[{composer.json,composer.lock}] -indent_size = 4 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d06804671fb3de6d0c25fba46e1c5a3975ba9050..1d234297765c87ae1bd91b78b1c00083d4047fc0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ include: - - project: 'gitlab-ci-cd/composer-packages' + - project: 'gitlab-ci-cd/drupal' ref: main - file: '/composer-packages.yml' + file: '/private-modules.yml' diff --git a/composer.json b/composer.json index 60aa4ba49e6b7e4f32e29833fdc0a0443246a97f..ffd0e77d264e8fda1fd5dd3194aeee4ec59f5c1b 100644 --- a/composer.json +++ b/composer.json @@ -1,67 +1,56 @@ { - "name": "lakedrops/ahoy", - "description": "This plugin collects available ahoy scripts from installed LakeDrops plugins and configures ahy in the project root.", - "type": "composer-plugin", - "keywords": [ - "Ahoy", - "Drupal", - "Development", - "Install", - "Update" - ], - "homepage": "https://gitlab.lakedrops.com/composer/plugin/ahoy", - "license": "GPL-2.0-or-later", - "authors": [ - { - "name": "Jürgen Haas", - "email": "juergen.haas@lakedrops.com", - "homepage": "https://www.lakedrops.com", - "role": "Drupal Expert" - }, - { - "name": "Daniel Speicher", - "email": "daniel.speicher@lakedrops.com", - "homepage": "https://www.lakedrops.com", - "role": "Drupal Expert" - }, - { - "name": "Richard Papp", - "email": "richard.papp@lakedrops.com", - "homepage": "https://www.lakedrops.com", - "role": "Drupal Expert" - } - ], - "support": { - "issues": "https://gitlab.lakedrops.com/composer/plugin/ahoy/issues", - "source": "https://gitlab.lakedrops.com/composer/plugin/ahoy/tree/main", - "docs": "https://devops-tools.docs.lakedrops.com/composer/plugin/ahoy/" + "name": "lakedrops/ahoy", + "description": "This plugin collects available ahoy scripts from installed LakeDrops plugins and configures ahy in the project root.", + "type": "composer-plugin", + "keywords": [ + "Ahoy", + "Drupal", + "Development", + "Install", + "Update" + ], + "homepage": "https://gitlab.lakedrops.com/composer/plugin/ahoy", + "license": "GPL-2.0-or-later", + "authors": [ + { + "name": "Jürgen Haas", + "email": "juergen.haas@lakedrops.com", + "homepage": "https://www.lakedrops.com", + "role": "Drupal Expert" }, - "require": { - "php": ">=7.4", - "composer-plugin-api": "^1||^2", - "lakedrops/composer-json-utils": "^2.0||dev-develop", - "symfony/yaml": "^3.4||^4.4||^5.0||^6.0" + { + "name": "Daniel Speicher", + "email": "daniel.speicher@lakedrops.com", + "homepage": "https://www.lakedrops.com", + "role": "Drupal Expert" }, - "require-dev": { - "composer/composer": "^1||^2", - "drupal/coder": "^8.3", - "phpunit/phpunit": "^9.5", - "roave/security-advisories": "dev-master", - "squizlabs/php_codesniffer": "^3.7" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "autoload": { - "psr-4": { - "LakeDrops\\Ahoy\\": "src/" - } - }, - "extra": { - "class": "LakeDrops\\Ahoy\\Plugin" + { + "name": "Richard Papp", + "email": "richard.papp@lakedrops.com", + "homepage": "https://www.lakedrops.com", + "role": "Drupal Expert" + } + ], + "support": { + "issues": "https://gitlab.lakedrops.com/composer/plugin/ahoy/issues", + "source": "https://gitlab.lakedrops.com/composer/plugin/ahoy/tree/main", + "docs": "https://devops-tools.docs.lakedrops.com/composer/plugin/ahoy/" + }, + "require": { + "php": ">=8.1", + "lakedrops/composer-json-utils": "^2.5||dev-develop", + "symfony/yaml": "*" + }, + "require-dev": { + "composer/composer": "^2", + "roave/security-advisories": "dev-latest" + }, + "autoload": { + "psr-4": { + "LakeDrops\\Ahoy\\": "src/" } + }, + "extra": { + "class": "LakeDrops\\Ahoy\\Plugin" + } } diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000000000000000000000000000000000..c5956cc9781bb549914ef8a7677cffa489922261 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 6 + checkMissingIterableValueType: false + checkGenericClassInNonGenericObjectType: false + treatPhpDocTypesAsCertain: false diff --git a/src/CommandProvider.php b/src/CommandProvider.php index b2cf5a0631a6d8c51718d3ffc2a8d6df67265e07..e15161ac420423e7b73aa00fea2c31c7e0a68934 100644 --- a/src/CommandProvider.php +++ b/src/CommandProvider.php @@ -4,6 +4,11 @@ namespace LakeDrops\Ahoy; use Composer\Plugin\Capability\CommandProvider as CommandProviderCapability; +/** + * Composer Command Provider for Ahoy. + * + * @package LakeDrops\Ahoy + */ class CommandProvider implements CommandProviderCapability { /** diff --git a/src/Handler.php b/src/Handler.php index 9788b25b7720c4ebccdffa43441d8be519ee838c..6aba6840c914883183be98c5bcfd069157479484 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -6,9 +6,9 @@ use LakeDrops\Component\Composer\BaseHandler; use Symfony\Component\Yaml\Yaml; /** - * Class Handler. + * Handler class to setup Drupal projects for Behat tests. * - * @package LakeDrops\Drupal8Scaffold + * @package LakeDrops\Ahoy */ class Handler extends BaseHandler { diff --git a/src/Plugin.php b/src/Plugin.php index 004bd21505bd114e72a3cce902c46f35c83424cf..ae4b3f206fe6cf1c8dd054eede3b5610c7daaa09 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -2,6 +2,7 @@ namespace LakeDrops\Ahoy; +use Composer\Plugin\Capability\CommandProvider as ComposerCommandProvider; use Composer\Script\Event; use Composer\Script\ScriptEvents; use LakeDrops\Component\Composer\BasePlugin; @@ -22,20 +23,20 @@ class Plugin extends BasePlugin { * {@inheritdoc} */ public function getCapabilities(): array { - return array( - \Composer\Plugin\Capability\CommandProvider::class => CommandProvider::class, - ); + return [ + ComposerCommandProvider::class => CommandProvider::class, + ]; } /** * {@inheritdoc} */ public static function getSubscribedEvents(): array { - return array( + return [ ScriptEvents::POST_CREATE_PROJECT_CMD => 'updateScripts', ScriptEvents::POST_INSTALL_CMD => 'updateScripts', ScriptEvents::POST_UPDATE_CMD => 'updateScripts', - ); + ]; } /** @@ -45,11 +46,10 @@ class Plugin extends BasePlugin { * The event that triggered the plugin. */ public function updateScripts(Event $event): void { - /** @var Handler $handler */ + /** @var \LakeDrops\Ahoy\Handler $handler */ $handler = $this->handler; - $handler - ->setEvent($event) - ->updateScripts(); + $handler->setEvent($event); + $handler->updateScripts(); } } diff --git a/src/UpdateCommand.php b/src/UpdateCommand.php index cf1b07c4b3d92b97efce62425f8fe1b73b0fe6f8..50757d76a85ef40be674726b99d318f15a4889bc 100644 --- a/src/UpdateCommand.php +++ b/src/UpdateCommand.php @@ -6,6 +6,11 @@ use LakeDrops\Component\Composer\BaseCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +/** + * Composer Update Command for Ahoy. + * + * @package LakeDrops\Ahoy + */ class UpdateCommand extends BaseCommand { /**