Skip to content

Commit

Permalink
Fix some psalm issues by annotating static props
Browse files Browse the repository at this point in the history
Signed-off-by: George Steel <[email protected]>
  • Loading branch information
gsteel committed Jul 24, 2022
1 parent fbe1509 commit 7371256
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
27 changes: 2 additions & 25 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,17 @@
</MixedAssignment>
</file>
<file src="src/AbstractWord.php">
<MissingPropertyType occurrences="4">
<code>$C</code>
<code>$CN</code>
<code>$V</code>
<code>$VN</code>
</MissingPropertyType>
<MixedArgument occurrences="3">
<code>$consonants</code>
<MixedArgument occurrences="1">
<code>$value['input']</code>
<code>$vowels</code>
</MixedArgument>
<MixedArrayAccess occurrences="2">
<code>$consonants[Rand::getInteger(0, $totIndexCon, true)]</code>
<code>$vowels[Rand::getInteger(0, $totIndexVow, true)]</code>
</MixedArrayAccess>
<MixedAssignment occurrences="7">
<code>$consonant</code>
<code>$consonants</code>
<MixedAssignment occurrences="3">
<code>$this-&gt;id</code>
<code>$this-&gt;word</code>
<code>$value</code>
<code>$vowel</code>
<code>$vowels</code>
</MixedAssignment>
<MixedInferredReturnType occurrences="1">
<code>string</code>
</MixedInferredReturnType>
<MixedOperand occurrences="1">
<code>$consonant</code>
</MixedOperand>
<MixedReturnStatement occurrences="1">
<code>$this-&gt;word</code>
</MixedReturnStatement>
Expand All @@ -48,10 +29,6 @@
<RedundantCastGivenDocblockType occurrences="1">
<code>(int) $ttl</code>
</RedundantCastGivenDocblockType>
<TooManyArguments occurrences="2">
<code>Rand::getInteger(0, $totIndexCon, true)</code>
<code>Rand::getInteger(0, $totIndexVow, true)</code>
</TooManyArguments>
<UnsafeInstantiation occurrences="1">
<code>new $this-&gt;sessionClass('Laminas_Form_Captcha_' . $id)</code>
</UnsafeInstantiation>
Expand Down
4 changes: 4 additions & 0 deletions src/AbstractWord.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ abstract class AbstractWord extends AbstractAdapter
/**#@+
* @var array Character sets
*/
/** @var list<string> */
public static $V = ["a", "e", "i", "o", "u", "y"];
/** @var list<string> */
public static $VN = ["a", "e", "i", "o", "u", "y", "2", "3", "4", "5", "6", "7", "8", "9"];
/** @var list<string> */
public static $C = ["b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z"];
/** @var list<string> */
public static $CN = ["b", "c", "d", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "z", "2", "3", "4", "5", "6", "7", "8", "9"];
/**#@-*/
// @codingStandardsIgnoreEnd
Expand Down

0 comments on commit 7371256

Please sign in to comment.