From 479de21511347246cea7d9ca2c8d12fb425a9f42 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 11 Nov 2022 22:39:01 +0100 Subject: [PATCH 01/13] Add support for assets-modules --- src/ModuleInstaller.php | 63 ++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index 854161c..e7ddd51 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -6,12 +6,21 @@ use Composer\Package\PackageInterface; use Composer\Installer\LibraryInstaller; +use function in_array; use function is_string; use function mb_strtolower; use function preg_match; +use function sprintf; class ModuleInstaller extends LibraryInstaller { + /** @var string */ + public const MIXED_CASE = 'ssp-mixedcase-module-name'; + + /** @var array */ + public const SUPPORTED = ['simplesamlphp-assets', 'simplesamlphp-module']; + + /** * {@inheritDoc} */ @@ -36,34 +45,62 @@ protected function getPackageBasePath(PackageInterface $package) } $name = $package->getPrettyName(); - if (!preg_match('@^.*/simplesamlphp-module-(.+)$@', $name, $matches)) { - throw new InvalidArgumentException('Unable to install module ' . $name .', package name must be on the form "VENDOR/simplesamlphp-module-MODULENAME".'); + if (!preg_match('@^.*/simplesamlphp-(module|assets)-(.+)$@', $name, $matches)) { + throw new InvalidArgumentException(sprintf( + 'Unable to install module %s, package name must be on the form "VENDOR/simplesamlphp-%s-MODULENAME".', + $name, + $matches[1] + )); } - $moduleDir = $matches[1]; + + $moduleType = $matches[1]; + $moduleDir = $matches[2]; if (!preg_match('@^[a-z0-9_.-]*$@', $moduleDir)) { - throw new InvalidArgumentException('Unable to install module ' . $name .', module name must only contain characters from a-z, 0-9, "_", "." and "-".'); - } - if ($moduleDir[0] === '.') { - throw new InvalidArgumentException('Unable to install module ' . $name .', module name cannot start with ".".'); + throw new InvalidArgumentException(sprintf( + 'Unable to install module %s, module name must only contain characters from a-z, 0-9, "_", "." and "-".', + $name + )); + } elseif ($moduleDir[0] === '.') { + throw new InvalidArgumentException(sprintf( + 'Unable to install module %s, module name cannot start with ".".', + $name + )); } /* Composer packages are supposed to only contain lowercase letters, but historically many modules have had names in mixed case. * We must provide a way to handle those. Here we allow the module directory to be overridden with a mixed case name. */ $extraData = $package->getExtra(); - if (isset($extraData['ssp-mixedcase-module-name'])) { - $mixedCaseModuleName = $extraData['ssp-mixedcase-module-name']; + if (isset($extraData[self::MIXED_CASE])) { + $mixedCaseModuleName = $extraData[self::MIXED_CASE]; if (!is_string($mixedCaseModuleName)) { - throw new InvalidArgumentException('Unable to install module ' . $name .', "ssp-mixedcase-module-name" must be a string.'); + throw new InvalidArgumentException(sprintf( + 'Unable to install module %s, "%s" must be a string.', + $name, + self::MIXED_CASE + )); } if (mb_strtolower($mixedCaseModuleName, 'utf-8') !== $moduleDir) { - throw new InvalidArgumentException('Unable to install module ' . $name .', "ssp-mixedcase-module-name" must match the package name except that it can contain uppercase letters.'); + throw new InvalidArgumentException(sprintf( + 'Unable to install module %s, "%s" must match the package name except that it can contain uppercase letters.', + $name, + self::MIXED_CASE + )); } $moduleDir = $mixedCaseModuleName; } - return $ssp_path . '/modules/' . $moduleDir; + switch ($moduleType) { + case 'assets': + return $ssp_path . '/public/' . $moduleDir; + break; + case 'module': + return $ssp_path . '/modules/' . $moduleDir; + break; + default: + throw new InvalidArgumentException(sprintf('Unsupported type: %s', $moduleType)); + } } @@ -72,6 +109,6 @@ protected function getPackageBasePath(PackageInterface $package) */ public function supports($packageType) { - return 'simplesamlphp-module' === $packageType; + return in_array($packageType, self::SUPPORTED); } } From 287640697539dd88b9ebf9c2058a89a08538ed48 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 11 Nov 2022 23:03:02 +0100 Subject: [PATCH 02/13] Add docs --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 3131061..45d17d6 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,14 @@ of your module. Your module will be installed in the `modules/` directory in the SimpleSAMLphp installation directory. +Assets modules +-------------- + +Asset modules are a special kidn of module that will install pre-built assets in +SimpleSAMLphp's `public/` directory. These modules follow a slightly different +naming convention `simplesamlphp-assets-` + + Installing your custom module ----------------------------- From 9fc43883549c6c1f5d17d242368e1bc641763145 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 11 Nov 2022 23:06:50 +0100 Subject: [PATCH 03/13] Add special case for base assets --- src/ModuleInstaller.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index e7ddd51..9e80ba2 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -45,7 +45,10 @@ protected function getPackageBasePath(PackageInterface $package) } $name = $package->getPrettyName(); - if (!preg_match('@^.*/simplesamlphp-(module|assets)-(.+)$@', $name, $matches)) { + if ($name === 'simplesamlphp/simplesamlphp-assets') { + // Special case for SimpleSAMLphp's base assets + return $ssp_path . '/public/base'; + } elseif (!preg_match('@^.*/simplesamlphp-(module|assets)-(.+)$@', $name, $matches)) { throw new InvalidArgumentException(sprintf( 'Unable to install module %s, package name must be on the form "VENDOR/simplesamlphp-%s-MODULENAME".', $name, From aa37c0cb012dfd2a15305c0a6cd626f76d6e6549 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 11 Nov 2022 23:16:23 +0100 Subject: [PATCH 04/13] Use assertions-lib --- composer.json | 5 ++++ src/ModuleInstaller.php | 54 ++++++++++++++++++++--------------- src/ModuleInstallerPlugin.php | 1 + 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/composer.json b/composer.json index 31b6dc1..840a778 100644 --- a/composer.json +++ b/composer.json @@ -15,6 +15,11 @@ "php": "^7.4 || ^8.0", "composer-plugin-api": "^1.1 || ^2.0", + "simplesamlphp/assert": "^0.8.0", "simplesamlphp/simplesamlphp": "*" + }, + "require-dev": { + "composer/composer": "^2.4", + "simplesamlphp/simplesamlphp-test-framework": "^1.2.1" } } diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index 9e80ba2..2fb7921 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -2,9 +2,9 @@ namespace SimpleSAML\Composer; -use InvalidArgumentException; use Composer\Package\PackageInterface; use Composer\Installer\LibraryInstaller; +use InvalidArgumentException; use function in_array; use function is_string; @@ -59,38 +59,46 @@ protected function getPackageBasePath(PackageInterface $package) $moduleType = $matches[1]; $moduleDir = $matches[2]; - if (!preg_match('@^[a-z0-9_.-]*$@', $moduleDir)) { - throw new InvalidArgumentException(sprintf( + Assert::regex( + $moduleDir, + '@^[a-z0-9_.-]*$@', + sprintf( 'Unable to install module %s, module name must only contain characters from a-z, 0-9, "_", "." and "-".', $name - )); - } elseif ($moduleDir[0] === '.') { - throw new InvalidArgumentException(sprintf( - 'Unable to install module %s, module name cannot start with ".".', - $name - )); - } - - /* Composer packages are supposed to only contain lowercase letters, but historically many modules have had names in mixed case. + ), + InvalidArgumentException::class + ); + + Assert::notStartsWith( + $moduleDir, + '.', + sprintf('Unable to install module %s, module name cannot start with ".".', $name), + InvalidArgumentException::class + ); + + /** + * Composer packages are supposed to only contain lowercase letters, but historically many modules have had names in mixed case. * We must provide a way to handle those. Here we allow the module directory to be overridden with a mixed case name. */ $extraData = $package->getExtra(); if (isset($extraData[self::MIXED_CASE])) { $mixedCaseModuleName = $extraData[self::MIXED_CASE]; - if (!is_string($mixedCaseModuleName)) { - throw new InvalidArgumentException(sprintf( - 'Unable to install module %s, "%s" must be a string.', - $name, - self::MIXED_CASE - )); - } - if (mb_strtolower($mixedCaseModuleName, 'utf-8') !== $moduleDir) { - throw new InvalidArgumentException(sprintf( + Assert::string( + $mixedCaseModuleName, + sprintf('Unable to install module %s, "%s" must be a string.', $name, self::MIXED_CASE), + InvalidArgumentException::class + ); + + Assert::same( + mb_strtolower($mixedCaseModuleName, 'utf-8'), + $moduleDir, + sprintf( 'Unable to install module %s, "%s" must match the package name except that it can contain uppercase letters.', $name, self::MIXED_CASE - )); - } + ), + InvalidArgumentException::class + ); $moduleDir = $mixedCaseModuleName; } diff --git a/src/ModuleInstallerPlugin.php b/src/ModuleInstallerPlugin.php index 2d787b8..506d3d6 100644 --- a/src/ModuleInstallerPlugin.php +++ b/src/ModuleInstallerPlugin.php @@ -17,6 +17,7 @@ class ModuleInstallerPlugin implements PluginInterface /** @var \Composer\IO\IOInterface */ private IOInterface $io; + /** * Apply plugin modifications to Composer * From 7ecbc3865762ef9268fd2e5a13b36c8bc7476a84 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 00:14:57 +0100 Subject: [PATCH 05/13] Fix --- src/ModuleInstaller.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index 2fb7921..894bb25 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -2,6 +2,7 @@ namespace SimpleSAML\Composer; +use SimpleSAML\Assert\Assert; use Composer\Package\PackageInterface; use Composer\Installer\LibraryInstaller; use InvalidArgumentException; From 88e3492c98c368cc25a753b43ba8ab3e9593293a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 00:18:45 +0100 Subject: [PATCH 06/13] Add .gitignore file --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce45e20 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.phpunit.result.cache +composer.lock +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock From ebc05bdc59a70bbba3e6ad13fc5c0a7dc3ba9520 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 00:32:23 +0100 Subject: [PATCH 07/13] Add unit tests --- phpunit.xml | 22 +++++++ src/ModuleInstaller.php | 3 +- tests/ModuleInstallerTest.php | 109 ++++++++++++++++++++++++++++++++++ tests/bootstrap.php | 6 ++ 4 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 phpunit.xml create mode 100644 tests/ModuleInstallerTest.php create mode 100644 tests/bootstrap.php diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..a00446c --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,22 @@ + + + + + ./src + + + ./tests + + + + + + + + + + ./tests + + + + diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index 894bb25..d725ac7 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -51,9 +51,8 @@ protected function getPackageBasePath(PackageInterface $package) return $ssp_path . '/public/base'; } elseif (!preg_match('@^.*/simplesamlphp-(module|assets)-(.+)$@', $name, $matches)) { throw new InvalidArgumentException(sprintf( - 'Unable to install module %s, package name must be on the form "VENDOR/simplesamlphp-%s-MODULENAME".', + 'Unable to install module %s, package name must be on the form "VENDOR/simplesamlphp-(module|assets)-MODULENAME".', $name, - $matches[1] )); } diff --git a/tests/ModuleInstallerTest.php b/tests/ModuleInstallerTest.php new file mode 100644 index 0000000..3d83751 --- /dev/null +++ b/tests/ModuleInstallerTest.php @@ -0,0 +1,109 @@ +setConfig(new Config()); + $partialComposer->setRepositoryManager(new RepositoryManager(new NullIO(), new Config(), new HttpDownloader(new NullIO(), new Config()))); + $partialComposer->getRepositoryManager()->setLocalRepository(new InstalledArrayRepository()); + $this->moduleInstaller = new ModuleInstaller(new NullIO(), $partialComposer); + } + + + /** + * @dataProvider packageProvider + */ + public function testGetInstallPath(bool $shouldPass, PackageInterface $package): void + { + try { + $this->moduleInstaller->getInstallPath($package); + $this->assertTrue($shouldPass); + } catch (InvalidArgumentException $e) { + $this->assertFalse($shouldPass); + } + } + + + /** + * @dataProvider packageTypeProvider + */ + public function testSupports(bool $shouldPass, string $packageType): void + { + $this->assertEquals( + $this->moduleInstaller->supports($packageType), + $shouldPass + ); + } + + + /** + * @return array + */ + public function packageTypeProvider(): array + { + return [ + 'simplesamlphp-module' => [true, 'simplesamlphp-module'], + 'simplesamlphp-assets' => [true, 'simplesamlphp-assets'], + 'simplesamlphp-anyother' => [false, 'simplesamlphp-anyother'], + ]; + } + + + /** + * @return array + */ + public function packageProvider(): array + { + return [ + 'base' => [ + true, + $this->getMockForAbstractClass(BasePackage::class, ['simplesamlphp/simplesamlphp-assets']), + ], + 'bogus-nonmodule' => [ + false, + $this->getMockForAbstractClass(BasePackage::class, ['simplesamlphp/simplesamlphp-bogus-nonmodule']), + ], + 'consent-assets' => [ + true, + $this->getMockForAbstractClass(BasePackage::class, ['simplesamlphp/simplesamlphp-assets-consent']), + ], + 'ldap' => [ + true, + $this->getMockForAbstractClass(BasePackage::class, ['simplesamlphp/simplesamlphp-module-ldap']), + ], + 'module' => [ + false, + $this->getMockForAbstractClass(BasePackage::class, ['simplesamlphp/simplesamlphp-module']), + ], + ]; + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..28c2413 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,6 @@ + Date: Sat, 12 Nov 2022 00:32:49 +0100 Subject: [PATCH 08/13] Add codecov config --- codecov.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 codecov.yml diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..1e5da32 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,16 @@ +coverage: + status: + project: + default: + target: 0% + threshold: 2% + patch: off +comment: + layout: "diff" + behavior: once + require_changes: true + require_base: no + require_head: yes + branches: null +github_checks: + annotations: false From 70fd8447b89cd0bcf1018657f324144b9a870736 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 00:53:53 +0100 Subject: [PATCH 09/13] Add unit tests & remove broken :uninstall --- .php_cs.dist | 15 +++++++++++ phpcs.xml | 15 +++++++++++ psalm.xml | 50 +++++++++++++++++++++++++++++++++++ src/ModuleInstaller.php | 8 ++++-- tests/ModuleInstallerTest.php | 4 ++- 5 files changed, 89 insertions(+), 3 deletions(-) create mode 100644 .php_cs.dist create mode 100644 phpcs.xml create mode 100644 psalm.xml diff --git a/.php_cs.dist b/.php_cs.dist new file mode 100644 index 0000000..b861fd2 --- /dev/null +++ b/.php_cs.dist @@ -0,0 +1,15 @@ +in([ + __DIR__ . '/src', + __DIR__ . '/tests', + ]) +; + +return PhpCsFixer\Config::create() + ->setRules([ + '@PSR2' => true, + ]) + ->setFinder($finder) +; diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..b93cbf3 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,15 @@ + + + + + + By default it is less stringent about long lines than other coding standards + + + src + tests + + + + + diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 0000000..7b5e6f5 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index d725ac7..47645cf 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -46,6 +46,7 @@ protected function getPackageBasePath(PackageInterface $package) } $name = $package->getPrettyName(); + $matches = []; if ($name === 'simplesamlphp/simplesamlphp-assets') { // Special case for SimpleSAMLphp's base assets return $ssp_path . '/public/base'; @@ -56,6 +57,7 @@ protected function getPackageBasePath(PackageInterface $package) )); } + Assert::count($matches, 2); $moduleType = $matches[1]; $moduleDir = $matches[2]; @@ -77,8 +79,10 @@ protected function getPackageBasePath(PackageInterface $package) ); /** - * Composer packages are supposed to only contain lowercase letters, but historically many modules have had names in mixed case. - * We must provide a way to handle those. Here we allow the module directory to be overridden with a mixed case name. + * Composer packages are supposed to only contain lowercase letters, + * but historically many modules have had names in mixed case. + * We must provide a way to handle those. Here we allow the module directory + * to be overridden with a mixed case name. */ $extraData = $package->getExtra(); if (isset($extraData[self::MIXED_CASE])) { diff --git a/tests/ModuleInstallerTest.php b/tests/ModuleInstallerTest.php index 3d83751..56b65ec 100644 --- a/tests/ModuleInstallerTest.php +++ b/tests/ModuleInstallerTest.php @@ -33,7 +33,9 @@ public function setUp(): void { $partialComposer = new PartialComposer(); $partialComposer->setConfig(new Config()); - $partialComposer->setRepositoryManager(new RepositoryManager(new NullIO(), new Config(), new HttpDownloader(new NullIO(), new Config()))); + $partialComposer->setRepositoryManager( + new RepositoryManager(new NullIO(), new Config(), new HttpDownloader(new NullIO(), new Config())) + ); $partialComposer->getRepositoryManager()->setLocalRepository(new InstalledArrayRepository()); $this->moduleInstaller = new ModuleInstaller(new NullIO(), $partialComposer); } From b648c4b282b43d478c14786bb2673eedce70e6c6 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 00:59:20 +0100 Subject: [PATCH 10/13] Add badges --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 45d17d6..ba3d6c4 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,14 @@ -SimpleSAMLphp Composer module installer -======================================= +# SimpleSAMLphpSimpleSAMLphp Composer module installer + +![Build Status](https://github.com/simplesamlphp/composer-module-installer/workflows/CI/badge.svg?branch=master) +[![Coverage Status](https://codecov.io/gh/simplesamlphp/composer-module-installer/branch/master/graph/badge.svg)](https://codecov.io/gh/simplesamlphp/composer-module-installer) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/simplesamlphp/composer-module-installer/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/simplesamlphp/composer-module-installer/?branch=master) +[![Type coverage](https://shepherd.dev/github/simplesamlphp/composer-module-installer/coverage.svg)](https://shepherd.dev/github/simplesamlphp/composer-module-installer) This package is a Composer plugin that allows a SimpleSAMLphp module to be installed through Composer. Installation can be as easy as executing: -``` +```bash composer.phar require vendor/simplesamlphp-module-mymodule 1.* ``` @@ -12,8 +16,7 @@ That command would install `vendor/simplesamlphp-module-mymodule` matching version `1.*`. -Making a module installable through Composer --------------------------------------------- +## Making a module installable through Composer To make a module installable through Composer, you need to add a `composer.json`-file to the root of the module. It should look @@ -32,7 +35,7 @@ something like: The package name must be on the form: -``` +```bash /simplesamlphp-module- ``` @@ -41,16 +44,14 @@ of your module. Your module will be installed in the `modules/` directory in the SimpleSAMLphp installation directory. -Assets modules --------------- +## Assets modules Asset modules are a special kidn of module that will install pre-built assets in SimpleSAMLphp's `public/` directory. These modules follow a slightly different naming convention `simplesamlphp-assets-` -Installing your custom module ------------------------------ +## Installing your custom module If you publish your module on [Packagist](https://packagist.org/), no special configuration is required to install your module. However, if your module is @@ -95,7 +96,7 @@ The `repositories array may look something like: Once you have added the repository, you should be able to install your module by executing: -``` +```bash composer.phar require vendor/simplesamlphp-module-mymodule:dev-master ``` @@ -106,8 +107,7 @@ See the [Composer Repository documentation](https://getcomposer.org/doc/05-repos for more information about adding your own custom repositories to Composer. -Module names that contain uppercase letters -------------------------------------------- +## Module names that contain uppercase letters New modules should only have lowercase letters in the module name, however a lot of existing module names contain uppercase letters. Since Composer package From ab0e5aa3ab45396880ff3abaada4511b4a037072 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 01:15:41 +0100 Subject: [PATCH 11/13] Remove dependency on ssp --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 840a778..c07e770 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,6 @@ "composer-plugin-api": "^1.1 || ^2.0", "simplesamlphp/assert": "^0.8.0", - "simplesamlphp/simplesamlphp": "*" }, "require-dev": { "composer/composer": "^2.4", From ec6b46aeca39510786c9211a92f447b719dbe0e7 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 01:23:56 +0100 Subject: [PATCH 12/13] Fix syntax --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c07e770..b9f8ec9 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": "^7.4 || ^8.0", "composer-plugin-api": "^1.1 || ^2.0", - "simplesamlphp/assert": "^0.8.0", + "simplesamlphp/assert": "^0.8.0" }, "require-dev": { "composer/composer": "^2.4", From d10cdab6ca0ed4d3be10e99c1c77d08fe3f4f78a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 12 Nov 2022 01:34:05 +0100 Subject: [PATCH 13/13] Remove unnecessary breaks --- src/ModuleInstaller.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ModuleInstaller.php b/src/ModuleInstaller.php index 47645cf..29c83f4 100644 --- a/src/ModuleInstaller.php +++ b/src/ModuleInstaller.php @@ -109,10 +109,8 @@ protected function getPackageBasePath(PackageInterface $package) switch ($moduleType) { case 'assets': return $ssp_path . '/public/' . $moduleDir; - break; case 'module': return $ssp_path . '/modules/' . $moduleDir; - break; default: throw new InvalidArgumentException(sprintf('Unsupported type: %s', $moduleType)); }