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/BaseCommand.php b/BaseCommand.php index c1627cc24bcac573bf854ccac8a39d9230604264..a482de1fe3ebd633436f71f919d3daca2404b47d 100644 --- a/BaseCommand.php +++ b/BaseCommand.php @@ -25,7 +25,7 @@ abstract class BaseCommand extends ComposerBaseCommand implements BaseCommandInt */ protected function execute(InputInterface $input, OutputInterface $output): int { $class = $this->getHandlerClass(); - $this->handler = new $class($this->getComposer(), $this->getIO()); + $this->handler = new $class($this->requireComposer(), $this->getIO()); $this->handler->setInput($input); return 0; } diff --git a/BaseHandler.php b/BaseHandler.php index 1bdb15c1e6675982ddea3303d14e0d6667161954..ad04ea30c169afea2c82ba8e7383dbff8ff9327c 100644 --- a/BaseHandler.php +++ b/BaseHandler.php @@ -117,7 +117,7 @@ abstract class BaseHandler implements BaseHandlerInterface { /** * {@inheritdoc} */ - public function setEvent(Event $event): BaseHandler { + public function setEvent(Event $event): self { $this->event = $event; return $this; } @@ -193,8 +193,8 @@ abstract class BaseHandler implements BaseHandlerInterface { /** * {@inheritdoc} */ - public function gitLFS(string $pattern): void { - Utils::gitLFS($pattern); + public function gitLfs(string $pattern): void { + Utils::gitLfs($pattern); } } diff --git a/BaseHandlerInterface.php b/BaseHandlerInterface.php index ed317e322a208962515368e4ff2689bc7d70efca..d6368b4f884969c5ef3238d3581b6f404e20bf74 100644 --- a/BaseHandlerInterface.php +++ b/BaseHandlerInterface.php @@ -104,6 +104,6 @@ interface BaseHandlerInterface { * @param string $pattern * The pattern which should be added. */ - public function gitLFS(string $pattern); + public function gitLfs(string $pattern); } diff --git a/Config.php b/Config.php index 8a0300826ad626b0c6c00ec7df0b99291b72f621..2fcc9afd0ce4ca5780013d518bee899a3beb951f 100644 --- a/Config.php +++ b/Config.php @@ -5,10 +5,10 @@ namespace LakeDrops\Component\Composer; use Composer\Json\JsonFile; use Seld\JsonLint\ParsingException; use Symfony\Component\Yaml\Yaml; +use Twig\Environment; use Twig\Error\LoaderError; use Twig\Error\RuntimeError; use Twig\Error\SyntaxError; -use Twig\Environment; use Twig\Loader\ArrayLoader; /** diff --git a/Utils.php b/Utils.php index 669ee974f94ed464be52117c60ea91bafee24ffc..d2dd3b273717692cd50bc3b5a39411b0b0167343 100644 --- a/Utils.php +++ b/Utils.php @@ -74,7 +74,7 @@ final class Utils { * @param string $pattern * The pattern to be added. */ - public static function gitLFS(string $pattern): void { + public static function gitLfs(string $pattern): void { if (!isset(self::$lfsGitPatterns)) { self::gitInit(); $output = []; diff --git a/composer.json b/composer.json index 28f4605f3849c427dcd49cd8e4044131a4ca3cf1..d1a3b2b6b8cc281fb390ac2048874dc58bc28b65 100644 --- a/composer.json +++ b/composer.json @@ -1,57 +1,54 @@ { - "name": "lakedrops/composer-json-utils", - "description": "Composer Library to provide utilities to work with project's own composer.json file", - "type": "library", - "keywords": ["Drupal", "Development", "Composer"], - "homepage": "https://gitlab.lakedrops.com/composer/library/composer-json-utils", - "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/library/composer-json-utils/issues", - "source": "https://gitlab.lakedrops.com/composer/library/composer-json-utils/tree/main", - "docs": "https://devops-tools.docs.lakedrops.com/composer/library/composer-json-utils/" + "name": "lakedrops/composer-json-utils", + "description": "Composer Library to provide utilities to work with project's own composer.json file", + "type": "library", + "keywords": [ + "Drupal", + "Development", + "Composer" + ], + "homepage": "https://gitlab.lakedrops.com/composer/library/composer-json-utils", + "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", - "ext-json": "*", - "symfony/dotenv": "^3.4||^4.4||^5.0||^6.0", - "symfony/yaml": "^3.4||^4.4||^5.0||^6.0", - "twig/twig": "^2.12||^3.4" + { + "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\\Component\\Composer\\": "" } + { + "name": "Richard Papp", + "email": "richard.papp@lakedrops.com", + "homepage": "https://www.lakedrops.com", + "role": "Drupal Expert" + } + ], + "support": { + "issues": "https://gitlab.lakedrops.com/composer/library/composer-json-utils/issues", + "source": "https://gitlab.lakedrops.com/composer/library/composer-json-utils/tree/main", + "docs": "https://devops-tools.docs.lakedrops.com/composer/library/composer-json-utils/" + }, + "require": { + "php": ">=8.1", + "ext-json": "*", + "composer-plugin-api": "^2", + "symfony/dotenv": "*", + "symfony/yaml": "*", + "twig/twig": "*" + }, + "require-dev": { + "composer/composer": "^2", + "roave/security-advisories": "dev-latest" + }, + "autoload": { + "psr-4": { + "LakeDrops\\Component\\Composer\\": "" } + } } 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