diff --git a/.releaserc b/.releaserc new file mode 100644 index 0000000000000000000000000000000000000000..c14297a084cbb04aefb693e14a1be9143675498a --- /dev/null +++ b/.releaserc @@ -0,0 +1,13 @@ +{ + "branches": ["master"], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/github", + ["@semantic-release/git", { + "assets": ["CHANGELOG.md"], + "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" + }] + ] +} diff --git a/README.md b/README.md index 75c6306ffc19bae34102ae9be47bea87b85d5b99..a926a5291213abb8503aca7520239b5f7fcaf886 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,19 @@ [](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) [](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) -[](https://www.codefactor.io/repository/github/cesnet/bbmri-aai-proxy-idp-template) +[](https://github.com/CESNET/bbmri-aai-proxy-idp-template/build_and_check.yml) [](https://packagist.org/packages/bbmri/simplesamlphp-module-bbmri) Template for BBMRI AAI Proxy IdP component - ## Instalation - `php composer.phar require bbmri/simplesamlphp-module-bbmri` \ No newline at end of file +## Contribution + +This repository uses [Conventional Commits](https://www.npmjs.com/package/@commitlint/config-conventional). + +Any change that significantly changes behavior in a backward-incompatible way or requires a configuration change must be marked as BREAKING CHANGE. + +### Available scopes: +* theme + +## Instalation +`php composer.phar require` diff --git a/composer.json b/composer.json index 5c55010f771b6894228dd20e5f09b20ecfdedef7..cc94e329e091085a00cd21d8582cadca7ed27f7a 100644 --- a/composer.json +++ b/composer.json @@ -17,5 +17,8 @@ ], "require": { "simplesamlphp/composer-module-installer": "~1.0" + }, + "require-dev": { + "symplify/easy-coding-standard": "^9.4" } } diff --git a/ecs.php b/ecs.php new file mode 100644 index 0000000000000000000000000000000000000000..9acbefbc4dcfd283b714f27b4e474a0108b10720 --- /dev/null +++ b/ecs.php @@ -0,0 +1,40 @@ +<?php + +declare(strict_types=1); + +use PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer; +use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; +use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\EasyCodingStandard\ValueObject\Set\SetList; + +return static function (ContainerConfigurator $containerConfigurator): void { + $services = $containerConfigurator->services(); + $services->set(ArraySyntaxFixer::class) + ->call('configure', [[ + 'syntax' => 'short', + ]]) + ; + + $parameters = $containerConfigurator->parameters(); + $parameters->set(Option::PATHS, [ + __DIR__ . '/ecs.php', + __DIR__ . '/config-templates', + __DIR__ . '/dictionaries', + __DIR__ . '/lib', + __DIR__ . '/themes', + __DIR__ . '/www', + __DIR__ . '/composer.json', + ]); + + $containerConfigurator->import(SetList::CLEAN_CODE); + $containerConfigurator->import(SetList::SYMPLIFY); + $containerConfigurator->import(SetList::ARRAY); + $containerConfigurator->import(SetList::COMMON); + $containerConfigurator->import(SetList::COMMENTS); + $containerConfigurator->import(SetList::CONTROL_STRUCTURES); + $containerConfigurator->import(SetList::DOCBLOCK); + $containerConfigurator->import(SetList::NAMESPACES); + $containerConfigurator->import(SetList::PHPUNIT); + $containerConfigurator->import(SetList::SPACES); + $containerConfigurator->import(SetList::PSR_12); +}; diff --git a/themes/bbmri/consent/consentform.php b/themes/bbmri/consent/consentform.php index 16ae7d96d080d8b8b691eb8aa59955f9c5216bcf..59c9db365d23a94e5057b20e4d9f7c42458fc1f1 100644 --- a/themes/bbmri/consent/consentform.php +++ b/themes/bbmri/consent/consentform.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/consentform.php'; diff --git a/themes/bbmri/consent/noconsent.php b/themes/bbmri/consent/noconsent.php index f7591fe10dc90c8e20d1fdd0c3fb9e681060bb88..c11bf621ea36073ce3c33e67678f1585415625ba 100644 --- a/themes/bbmri/consent/noconsent.php +++ b/themes/bbmri/consent/noconsent.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/consent/noconsent.php'; diff --git a/themes/bbmri/core/loginuserpass.php b/themes/bbmri/core/loginuserpass.php index f298450d355d8553f08f0cc14119ff4a4d3744e1..93f4a38f6d880fbdb28793a910b95208958c67c1 100644 --- a/themes/bbmri/core/loginuserpass.php +++ b/themes/bbmri/core/loginuserpass.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/core/loginuserpass.php'; diff --git a/themes/bbmri/default/error.php b/themes/bbmri/default/error.php index d2244cc225f26609df318445a11cb1f5107f6596..af1cc1c08c6aaed30c6c962267b3adc9fd983fb2 100644 --- a/themes/bbmri/default/error.php +++ b/themes/bbmri/default/error.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/error.php'; diff --git a/themes/bbmri/default/errorreport.php b/themes/bbmri/default/errorreport.php index e45fc9388e513b77289fff29fa4b5a6dc5b16e50..1c8e75cab036d796e28bae02e5dcdb6a49a336dc 100644 --- a/themes/bbmri/default/errorreport.php +++ b/themes/bbmri/default/errorreport.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/errorreport.php'; diff --git a/themes/bbmri/default/includes/footer.php b/themes/bbmri/default/includes/footer.php index 7907ddb7fd8ba139b336f86441c2a8be59b01b8c..2fbb56be03ca68e5f4b1986586e563916a0c66d8 100644 --- a/themes/bbmri/default/includes/footer.php +++ b/themes/bbmri/default/includes/footer.php @@ -1,8 +1,8 @@ -<?php +<?php declare(strict_types=1); use SimpleSAML\Module; -if (!empty($this->data['htmlinject']['htmlContentPost'])) { +if (! empty($this->data['htmlinject']['htmlContentPost'])) { foreach ($this->data['htmlinject']['htmlContentPost'] as $c) { echo $c; } @@ -17,8 +17,8 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) { <div style="float: left;"> <img src="<?php echo Module::getModuleUrl( - 'bbmri/res/img/BBMRI-ERIC-gateway-for-health_216.png' - ) ?>"> + 'bbmri/res/img/BBMRI-ERIC-gateway-for-health_216.png' +) ?>"> </div> <div style="float: left;"> @@ -26,7 +26,7 @@ if (!empty($this->data['htmlinject']['htmlContentPost'])) { +43 316 34 99 17-0 <a href="mailto:contact@bbmri-eric.eu">contact@bbmri-eric.eu</a> </p> - <p>Copyright © BBMRI-ERIC <?php echo date("Y"); ?> </p> + <p>Copyright © BBMRI-ERIC <?php echo date('Y'); ?> </p> </div> </div> diff --git a/themes/bbmri/default/includes/header.php b/themes/bbmri/default/includes/header.php index da9744a31fa7bdec46d0763ac9bb92e54f2ee6a6..c6e11a8a0faf329812ba41200d01201227eff748 100644 --- a/themes/bbmri/default/includes/header.php +++ b/themes/bbmri/default/includes/header.php @@ -1,4 +1,4 @@ -<?php +<?php declare(strict_types=1); use SimpleSAML\Module; @@ -22,7 +22,7 @@ if (array_key_exists('pageid', $this->data)) { 'post' => &$this->data['htmlinject']['htmlContentPost'], 'head' => &$this->data['htmlinject']['htmlContentHead'], 'jquery' => &$jquery, - 'page' => $this->data['pageid'] + 'page' => $this->data['pageid'], ]; Module::callHooks('htmlinject', $hookinfo); @@ -30,13 +30,11 @@ if (array_key_exists('pageid', $this->data)) { // - o - o - o - o - o - o - o - o - o - o - o - o - /** - * Do not allow to frame SimpleSAMLphp pages from another location. - * This prevents clickjacking attacks in modern browsers. + * Do not allow to frame SimpleSAMLphp pages from another location. This prevents clickjacking attacks in modern + * browsers. * - * If you don't want any framing at all you can even change this to - * 'DENY', or comment it out if you actually want to allow foreign - * sites to put SimpleSAMLphp in a frame. The latter is however - * probably not a good security practice. + * If you don't want any framing at all you can even change this to 'DENY', or comment it out if you actually want to + * allow foreign sites to put SimpleSAMLphp in a frame. The latter is however probably not a good security practice. */ header('X-Frame-Options: SAMEORIGIN'); @@ -49,9 +47,9 @@ header('X-Frame-Options: SAMEORIGIN'); <script type="text/javascript" src="/<?php echo $this->data['baseurlpath']; ?>resources/script.js"></script> <title><?php if (array_key_exists('header', $this->data)) { - echo $this->data['header']; + echo $this->data['header']; } else { - echo 'SimpleSAMLphp'; + echo 'SimpleSAMLphp'; } ?></title> @@ -61,26 +59,26 @@ header('X-Frame-Options: SAMEORIGIN'); <?php - if (!empty($jquery)) { + if (! empty($jquery)) { $version = '1.8'; if (array_key_exists('version', $jquery)) { $version = $jquery['version']; } - if ($version == '1.8') { + if ($version === '1.8') { if (isset($jquery['core']) && $jquery['core']) { - echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . - 'resources/jquery-1.8.js"></script>' . "\n"); + echo '<script type="text/javascript" src="/' . $this->data['baseurlpath'] . + 'resources/jquery-1.8.js"></script>' . "\n"; } if (isset($jquery['ui']) && $jquery['ui']) { - echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . - 'resources/jquery-ui-1.8.js"></script>' . "\n"); + echo '<script type="text/javascript" src="/' . $this->data['baseurlpath'] . + 'resources/jquery-ui-1.8.js"></script>' . "\n"; } if (isset($jquery['css']) && $jquery['css']) { - echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . - 'resources/uitheme1.8/jquery-ui.css" />' . "\n"); + echo '<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . + 'resources/uitheme1.8/jquery-ui.css" />' . "\n"; } } } @@ -90,7 +88,7 @@ header('X-Frame-Options: SAMEORIGIN'); 'resources/clipboard.min.js"></script>' . "\n"; } - if (!empty($this->data['htmlinject']['htmlContentHead'])) { + if (! empty($this->data['htmlinject']['htmlContentHead'])) { foreach ($this->data['htmlinject']['htmlContentHead'] as $c) { echo $c; } @@ -139,7 +137,7 @@ if ($onLoad !== '') { alt="BBMRI-ERIC logo"> <h1> <?php - echo(isset($this->data['header']) ? $this->data['header'] : 'BBMRI-ERIC proxy IdP'); + echo isset($this->data['header']) ? $this->data['header'] : 'BBMRI-ERIC proxy IdP'; ?> </h1> </div> @@ -148,7 +146,7 @@ if ($onLoad !== '') { <?php -if (!empty($this->data['htmlinject']['htmlContentPre'])) { +if (! empty($this->data['htmlinject']['htmlContentPre'])) { foreach ($this->data['htmlinject']['htmlContentPre'] as $c) { echo $c; } diff --git a/themes/bbmri/default/post.php b/themes/bbmri/default/post.php index 7c314b73b9ac437af245d3ea26ce4abf3b8e89b9..e7e3e5af47db2572a514b0bb24270a20ecd239e4 100644 --- a/themes/bbmri/default/post.php +++ b/themes/bbmri/default/post.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/default/post.php'; diff --git a/themes/bbmri/perun/disco-tpl.php b/themes/bbmri/perun/disco-tpl.php index aed11079b88a1c2c0f1fe5787cf56c2ee449a581..6833b67d4dabbc4c8e4ad5c026ba8b6c7e62da43 100644 --- a/themes/bbmri/perun/disco-tpl.php +++ b/themes/bbmri/perun/disco-tpl.php @@ -1,3 +1,5 @@ <?php +declare(strict_types=1); + include \SimpleSAML\Module::getModuleDir('perun') . '/themes/perun/perun/disco-tpl.php';