diff options
author | 2022-08-06 22:46:28 +0200 | |
---|---|---|
committer | 2022-08-06 22:46:28 +0200 | |
commit | 2bbce8ebef8cf4f88392431aabe84a15482dc933 (patch) | |
tree | 1f5027ca69b1dfa2364bd9319e8536b86a41e928 /lib/ParameterValidator.php | |
parent | b042412416cc4ecc71c3f9c13239661a0dd588a6 (diff) | |
download | rss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.tar.gz rss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.tar.zst rss-bridge-2bbce8ebef8cf4f88392431aabe84a15482dc933.zip |
refactor: general code base refactor (#2950)
* refactor
* fix: bug in previous refactor
* chore: exclude phpcompat sniff due to bug in phpcompat
* fix: do not leak absolute paths
* refactor/fix: batch extensions checking, fix DOS issue
Diffstat (limited to 'lib/ParameterValidator.php')
-rw-r--r-- | lib/ParameterValidator.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/ParameterValidator.php b/lib/ParameterValidator.php index a903ff8d..31934432 100644 --- a/lib/ParameterValidator.php +++ b/lib/ParameterValidator.php @@ -35,7 +35,7 @@ class ParameterValidator { $this->invalid[] = [ 'name' => $name, - 'reason' => $reason + 'reason' => $reason, ]; } @@ -216,7 +216,7 @@ class ParameterValidator if (array_key_exists('global', $parameters)) { $notInContext = array_diff_key($notInContext, $parameters['global']); } - if (sizeof($notInContext) > 0) { + if (count($notInContext) > 0) { continue; } @@ -246,7 +246,8 @@ class ParameterValidator unset($queriedContexts['global']); switch (array_sum($queriedContexts)) { - case 0: // Found no match, is there a context without parameters? + case 0: + // Found no match, is there a context without parameters? if (isset($data['context'])) { return $data['context']; } @@ -256,7 +257,8 @@ class ParameterValidator } } return null; - case 1: // Found unique match + case 1: + // Found unique match return array_search(true, $queriedContexts); default: return false; |