Skip to content

Commit cbe0b11

Browse files
I'm tired of wrestling with this.
We conditionally define random_bytes() and fallback to an implementation that ALWAYS throws an Exception. However, in libraries that consume random_compat, we want the type hint to always be a string. So, I'm done. Suppress the damn error (but still print it) and let's move on with our lives.
1 parent 71883fb commit cbe0b11

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

lib/random.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ class_exists('COM')
204204
*
205205
* @param mixed $length
206206
* @psalm-suppress MissingReturnType
207+
* @psalm-suppress InvalidReturnType
207208
* @throws Exception
208209
* @return string
209210
*/

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<InvalidOperand errorLevel="info" />
1515
<UndefinedConstant errorLevel="info" />
1616
<MissingReturnType errorLevel="info" />
17+
<InvalidReturnType errorLevel="info" />
1718
</issueHandlers>
1819
</psalm>

0 commit comments

Comments
 (0)