Skip to content

Commit

Permalink
rex_finder: more precise parameter types (#5659)
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Mar 22, 2023
1 parent 2525721 commit 8907a3a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 43 deletions.
35 changes: 0 additions & 35 deletions .tools/phpstan/baseline.neon
Expand Up @@ -1605,11 +1605,6 @@ parameters:
count: 1
path: ../../redaxo/src/core/lib/clang/perm.php

-
message: "#^Method rex_config\\:\\:set\\(\\) has parameter \\$key with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/config.php

-
message: "#^Method rex_config_db\\:\\:__construct\\(\\) has parameter \\$dbConfig with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -2105,11 +2100,6 @@ parameters:
count: 1
path: ../../redaxo/src/core/lib/packages/interface.php

-
message: "#^Method rex_package_interface\\:\\:setConfig\\(\\) has parameter \\$key with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/packages/interface.php

-
message: "#^If condition is always false\\.$#"
count: 1
Expand All @@ -2135,21 +2125,11 @@ parameters:
count: 1
path: ../../redaxo/src/core/lib/packages/null.php

-
message: "#^Method rex_null_package\\:\\:setConfig\\(\\) has parameter \\$key with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/packages/null.php

-
message: "#^Method rex_package\\:\\:includeFile\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/packages/package.php

-
message: "#^Method rex_package\\:\\:setConfig\\(\\) has parameter \\$key with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/packages/package.php

-
message: "#^Property rex_package\\:\\:\\$properties type has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -2175,11 +2155,6 @@ parameters:
count: 1
path: ../../redaxo/src/core/lib/response.php

-
message: "#^Method rex\\:\\:setConfig\\(\\) has parameter \\$key with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/rex.php

-
message: "#^Method rex_select\\:\\:addArrayOptions\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -2600,16 +2575,6 @@ parameters:
count: 1
path: ../../redaxo/src/core/lib/util/finder.php

-
message: "#^Method rex_finder\\:\\:ignoreDirs\\(\\) has parameter \\$glob with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/util/finder.php

-
message: "#^Method rex_finder\\:\\:ignoreFiles\\(\\) has parameter \\$glob with no value type specified in iterable type array\\.$#"
count: 1
path: ../../redaxo/src/core/lib/util/finder.php

-
message: "#^Method rex_formatter\\:\\:bytes\\(\\) has parameter \\$format with no value type specified in iterable type array\\.$#"
count: 1
Expand Down
3 changes: 0 additions & 3 deletions .tools/psalm/baseline.xml
Expand Up @@ -3515,9 +3515,6 @@
<ArgumentTypeCoercion>
<code><![CDATA[$cfg->getValue('value')]]></code>
</ArgumentTypeCoercion>
<MixedArgumentTypeCoercion>
<code>$k</code>
</MixedArgumentTypeCoercion>
<MixedAssignment>
<code>$v</code>
<code>$value</code>
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/core/lib/config.php
Expand Up @@ -59,7 +59,7 @@ class rex_config
* The set-method returns TRUE when an existing value was overridden, otherwise FALSE is returned.
*
* @param string $namespace The namespace e.g. an addon name
* @param string|array $key The associated key or an associative array of key/value pairs
* @param string|array<string, mixed> $key The associated key or an associative array of key/value pairs
* @param mixed $value The value to save
*
* @throws InvalidArgumentException
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/core/lib/packages/interface.php
Expand Up @@ -79,7 +79,7 @@ public function getCachePath($file = '');

/**
* @see rex_config::set()
* @param string|array $key The associated key or an associative array of key/value pairs
* @param string|array<string, mixed> $key The associated key or an associative array of key/value pairs
* @param mixed $value The value to save
* @return bool TRUE when an existing value was overridden, otherwise FALSE
*/
Expand Down
2 changes: 1 addition & 1 deletion redaxo/src/core/lib/rex.php
Expand Up @@ -21,7 +21,7 @@ class rex
/**
* @see rex_config::set()
*
* @param string|array $key The associated key or an associative array of key/value pairs
* @param string|array<string, mixed> $key The associated key or an associative array of key/value pairs
* @param mixed $value The value to save
* @return bool TRUE when an existing value was overridden, otherwise FALSE
*/
Expand Down
4 changes: 2 additions & 2 deletions redaxo/src/core/lib/util/finder.php
Expand Up @@ -131,7 +131,7 @@ public function dirsOnly()
/**
* Ignore all files which match the given glob pattern.
*
* @param string|array $glob Glob pattern or an array of glob patterns
* @param string|string[] $glob Glob pattern or an array of glob patterns
* @param bool $recursive When FALSE the patterns won't be checked in child directories
*
* @return $this
Expand All @@ -151,7 +151,7 @@ public function ignoreFiles($glob, $recursive = true)
/**
* Ignore all directories which match the given glob pattern.
*
* @param string|array $glob Glob pattern or an array of glob patterns
* @param string|string[] $glob Glob pattern or an array of glob patterns
* @param bool $recursive When FALSE the patterns won't be checked in child directories
*
* @return $this
Expand Down

0 comments on commit 8907a3a

Please sign in to comment.