From 901374a053945888cebea441a47680906619b24b Mon Sep 17 00:00:00 2001 From: Peter Sheppard Date: Fri, 13 Jun 2025 14:17:29 +0100 Subject: [PATCH 1/2] Fix PHPdoc return tags and a code warning - Added @return tags - Removed additional parameter in function call - if it was intended to be a default, or worked as one a long time ago, it would be caught by the Assert now --- src/MetaLoader.php | 8 ++++---- src/MetaRefresh.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/MetaLoader.php b/src/MetaLoader.php index e7faf30..d0f4098 100644 --- a/src/MetaLoader.php +++ b/src/MetaLoader.php @@ -214,7 +214,7 @@ public function loadSource(array $source): void /** * @param \SimpleSAML\Metadata\SAMLParser $entity * @param array $source - * @bool + * @return bool */ private function processCertificates(Metadata\SAMLParser $entity, array $source): bool { @@ -234,7 +234,7 @@ private function processCertificates(Metadata\SAMLParser $entity, array $source) /** * @param \SimpleSAML\Metadata\SAMLParser $entity * @param array $source - * @bool + * @return bool */ private function processBlacklist(Metadata\SAMLParser $entity, array $source): bool { @@ -251,7 +251,7 @@ private function processBlacklist(Metadata\SAMLParser $entity, array $source): b /** * @param \SimpleSAML\Metadata\SAMLParser $entity * @param array $source - * @bool + * @return bool */ private function processWhitelist(Metadata\SAMLParser $entity, array $source): bool { @@ -268,7 +268,7 @@ private function processWhitelist(Metadata\SAMLParser $entity, array $source): b /** * @param \SimpleSAML\Metadata\SAMLParser $entity * @param array $source - * @bool + * @return bool */ private function processAttributeWhitelist(Metadata\SAMLParser $entity, array $source): bool { diff --git a/src/MetaRefresh.php b/src/MetaRefresh.php index 86770f1..6f8ae64 100644 --- a/src/MetaRefresh.php +++ b/src/MetaRefresh.php @@ -66,7 +66,7 @@ public function runRefresh(string $crontag = null): void throw new Exception("Invalid outputDir specified."); } - $outputFormat = $set->getValueValidate('outputFormat', ['flatfile', 'serialize', 'pdo'], 'flatfile'); + $outputFormat = $set->getValueValidate('outputFormat', ['flatfile', 'serialize', 'pdo']); $oldMetadataSrc = MetaDataStorageSource::getSource([ 'type' => $outputFormat, From 021591445d3335bba975ad782a26a224c3517e2f Mon Sep 17 00:00:00 2001 From: Peter Sheppard Date: Fri, 13 Jun 2025 14:39:47 +0100 Subject: [PATCH 2/2] Revert removal and switch to getOptionalValueValidate() --- src/MetaRefresh.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MetaRefresh.php b/src/MetaRefresh.php index 6f8ae64..1e6c1b7 100644 --- a/src/MetaRefresh.php +++ b/src/MetaRefresh.php @@ -66,7 +66,7 @@ public function runRefresh(string $crontag = null): void throw new Exception("Invalid outputDir specified."); } - $outputFormat = $set->getValueValidate('outputFormat', ['flatfile', 'serialize', 'pdo']); + $outputFormat = $set->getOptionalValueValidate('outputFormat', ['flatfile', 'serialize', 'pdo'], 'flatfile'); $oldMetadataSrc = MetaDataStorageSource::getSource([ 'type' => $outputFormat,