From dc88dcce1eea1f0fa0ca5ef68fbe9905eddf30d1 Mon Sep 17 00:00:00 2001 From: Andrey Savchenko Date: Fri, 21 Feb 2020 18:22:53 +0200 Subject: [PATCH] Adjusted bunch of inline doc to make Psalm pass again. --- psalm.xml | 1 + src/Formatter/Backtrace_Formatter.php | 4 ++-- src/Mustache_Cache_FrozenCache.php | 4 ++-- src/Record/Collector/Http_Collector.php | 4 +--- src/Record/Collector/Plugin_Load_Collector.php | 2 ++ 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/psalm.xml b/psalm.xml index a7e6106..1179766 100644 --- a/psalm.xml +++ b/psalm.xml @@ -18,5 +18,6 @@ + diff --git a/src/Formatter/Backtrace_Formatter.php b/src/Formatter/Backtrace_Formatter.php index b89738d..202599e 100644 --- a/src/Formatter/Backtrace_Formatter.php +++ b/src/Formatter/Backtrace_Formatter.php @@ -76,12 +76,12 @@ class Backtrace_Formatter { } /** + * + * @psalm-suppress PossiblyFalseOperand * * @param string $item Backtrace item. * * @return string - * - * @psalm-suppress PossiblyFalseOperand */ protected function shorten_include( string $item ): string { diff --git a/src/Mustache_Cache_FrozenCache.php b/src/Mustache_Cache_FrozenCache.php index 08427c3..1eb8449 100644 --- a/src/Mustache_Cache_FrozenCache.php +++ b/src/Mustache_Cache_FrozenCache.php @@ -11,12 +11,12 @@ class Mustache_Cache_FrozenCache extends \Mustache_Cache_FilesystemCache { /** * Cache and load a compiled Mustache_Template class. * + * @psalm-suppress InvalidScalarArgument + * * @param string $key Key. * @param string $value Value. * * @return void - * - * @psalm-suppress InvalidScalarArgument */ public function cache( $key, $value ): void { diff --git a/src/Record/Collector/Http_Collector.php b/src/Record/Collector/Http_Collector.php index cc31f58..1baaa06 100644 --- a/src/Record/Collector/Http_Collector.php +++ b/src/Record/Collector/Http_Collector.php @@ -61,9 +61,7 @@ class Http_Collector extends Stopwatch_Collector { * @param array $args HTTP request arguments. * @param string $url The request URL. * - * @return mixed - * - * @noinspection MoreThanThreeArgumentsInspection + * @return array|\WP_Error */ public function http_api_debug( $response, string $type, $class, array $args, string $url ) { diff --git a/src/Record/Collector/Plugin_Load_Collector.php b/src/Record/Collector/Plugin_Load_Collector.php index 22f8d95..f4bdf08 100644 --- a/src/Record/Collector/Plugin_Load_Collector.php +++ b/src/Record/Collector/Plugin_Load_Collector.php @@ -31,6 +31,8 @@ class Plugin_Load_Collector implements Record_Collector_Interface { * Records time for a plugin that just finished loading. * * @param string $plugin Plugin file path. + * + * @psalm-suppress DocblockTypeContradiction */ public function plugin_loaded( $plugin ): void {