Skip to content

Commit

Permalink
Fixed some static-analysis issues and set a baseline for the single r…
Browse files Browse the repository at this point in the history
…emaing issue
  • Loading branch information
PHLAK committed Mar 20, 2020
1 parent 8f45a5c commit 888b544
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.9.5@0cfe565d0afbcd31eadcc281b9017b5692911661">
<file src="src/Traits/Transformable.php">
<PossiblyNullArgument occurrences="1">
<code>$count</code>
</PossiblyNullArgument>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml"
>
<projectFiles>
<directory name="src" />
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Encodable.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function hex(string $mode = Config\Hex::ENCODE): self

case Config\Hex::DECODE:
$string = preg_replace_callback('/\\\\x([0-9A-Fa-f]+)/', function (array $matched) {
return mb_chr(hexdec($matched[1]), $this->encoding);
return (string) mb_chr(hexdec($matched[1]), $this->encoding);
}, $this->string);
break;

Expand Down
2 changes: 1 addition & 1 deletion src/Traits/Transformable.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function reverse(): self
*
* @param string|array $search One or more strings to be replaced
* @param string|array $replace One or more strings to replace with
* @param int $count This will be set to the number of replacements performed
* @param int|null $count This will be set to the number of replacements performed
*
* @return self
*/
Expand Down

0 comments on commit 888b544

Please sign in to comment.