Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Nov 16, 2023
1 parent ffb30e2 commit a8b99c0
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"ext-json": "*",
"phpunit/phpunit": "^9",
"jetbrains/phpstorm-stubs": "^2019.3",
"psalm/phar": "^4.7"
"psalm/phar": "^5"
},
"autoload": {
"psr-4": {
Expand Down
43 changes: 43 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="src/EventLoop/Driver/EvDriver.php">
<UnsupportedPropertyReferenceUsage>
<code><![CDATA[self::$activeSignals = &$this->signals]]></code>
<code><![CDATA[self::$activeSignals = &$this->signals]]></code>
</UnsupportedPropertyReferenceUsage>
</file>
<file src="src/EventLoop/Driver/EventDriver.php">
<UnsupportedPropertyReferenceUsage>
<code><![CDATA[self::$activeSignals = &$this->signals]]></code>
<code><![CDATA[self::$activeSignals = &$this->signals]]></code>
</UnsupportedPropertyReferenceUsage>
</file>
<file src="src/EventLoop/Driver/StreamSelectDriver.php">
<RedundantCast>
<code>(int) ($timeout * 1_000_000)</code>
</RedundantCast>
</file>
<file src="src/EventLoop/Driver/TracingDriver.php">
<InvalidArgument>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
<code>\debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS)</code>
</InvalidArgument>
</file>
<file src="src/EventLoop/Driver/UvDriver.php">
<UndefinedFunction>
<code><![CDATA[\uv_poll_init_socket($this->handle, $callback->stream)]]></code>
<code><![CDATA[\uv_signal_init($this->handle)]]></code>
<code><![CDATA[\uv_signal_start($event, $this->signalCallback, $callback->signal)]]></code>
</UndefinedFunction>
</file>
<file src="src/EventLoop/Internal/AbstractDriver.php">
<RedundantCondition>
<code><![CDATA[!$this->stopped]]></code>
</RedundantCondition>
</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="examples"/>
Expand Down
4 changes: 2 additions & 2 deletions src/EventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public static function getType(string $callbackId): CallbackType
*
* @param string $callbackId The callback identifier.
*
* @return bool {@code true} if the callback is currently enabled, otherwise {@code false}.
* @return bool `true` if the callback is currently enabled, otherwise `false`.
*/
public static function isEnabled(string $callbackId): bool
{
Expand All @@ -358,7 +358,7 @@ public static function isEnabled(string $callbackId): bool
*
* @param string $callbackId The callback identifier.
*
* @return bool {@code true} if the callback is currently referenced, otherwise {@code false}.
* @return bool `true` if the callback is currently referenced, otherwise `false`.
*/
public static function isReferenced(string $callbackId): bool
{
Expand Down
4 changes: 2 additions & 2 deletions src/EventLoop/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function getType(string $callbackId): CallbackType;
*
* @param string $callbackId The callback identifier.
*
* @return bool {@code true} if the callback is currently enabled, otherwise {@code false}.
* @return bool `true` if the callback is currently enabled, otherwise `false`.
*/
public function isEnabled(string $callbackId): bool;

Expand All @@ -303,7 +303,7 @@ public function isEnabled(string $callbackId): bool;
*
* @param string $callbackId The callback identifier.
*
* @return bool {@code true} if the callback is currently referenced, otherwise {@code false}.
* @return bool `true` if the callback is currently referenced, otherwise `false`.
*/
public function isReferenced(string $callbackId): bool;

Expand Down
1 change: 1 addition & 0 deletions src/EventLoop/Internal/DriverSuspension.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public function suspend(): mixed
{
// Throw exception when trying to use old dead {main} suspension
if ($this->deadMain) {
\assert($this->error !== null);
throw $this->error;
}
if ($this->pending) {
Expand Down

0 comments on commit a8b99c0

Please sign in to comment.