From d6d3d232fed9c8eb5b9d023bb7b5c2aaeeabb4a8 Mon Sep 17 00:00:00 2001 From: techno-express Date: Thu, 29 Apr 2021 15:33:33 -0400 Subject: [PATCH] code coverage ignore --- Spawn/Channeled.php | 3 +++ Spawn/Core.php | 10 ++++++++-- Spawn/SerializableException.php | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Spawn/Channeled.php b/Spawn/Channeled.php index ff3033a..d50fcee 100644 --- a/Spawn/Channeled.php +++ b/Spawn/Channeled.php @@ -115,6 +115,9 @@ public static function throwClosed(string $errorMessage): void throw new \Error($errorMessage); } + /** + * @codeCoverageIgnore + */ public static function throwIllegalValue(string $errorMessage): void { throw new \InvalidArgumentException($errorMessage); diff --git a/Spawn/Core.php b/Spawn/Core.php index 06fb278..dd979d5 100644 --- a/Spawn/Core.php +++ b/Spawn/Core.php @@ -336,6 +336,7 @@ function parallel($task, ...$argv): FutureInterface } } + // @codeCoverageIgnoreStart $executable = function () use ($task, $argv, $___parallel___) { if (\is_array($___parallel___)) \set_globals($___parallel___); @@ -344,6 +345,7 @@ function parallel($task, ...$argv): FutureInterface $___channeled___ = 'parallel'; return $task(...$argv); }; + // @codeCoverageIgnoreEnd return Spawn::create($executable, 0, $channel, false)->displayOn(); } @@ -440,6 +442,8 @@ function get_globals(array $vars): array /** * Returns an array of all `user defined` global variables, without `super globals`. * @return array + * + * @codeCoverageIgnore */ function parallel_globals(): array { @@ -462,8 +466,9 @@ function set_globals(array $spawn_globals): void * Check if a string is base64 valid, or has `encoded` mixed data. * * @param string $input - * * @return bool|null if `null` **$input** is mixed with `encode` data. + * + * @codeCoverageIgnore */ function is_base64($input): ?bool { @@ -521,8 +526,9 @@ function deserializer($input) * **serialized** decoded data representation. * * @param string $input - * * @return mixed + * + * @codeCoverageIgnore */ function deserialize($input) { diff --git a/Spawn/SerializableException.php b/Spawn/SerializableException.php index d42a3ca..c5dd102 100644 --- a/Spawn/SerializableException.php +++ b/Spawn/SerializableException.php @@ -32,8 +32,8 @@ public function asThrowable(): Throwable try { /** @var Throwable $throwable */ $throwable = new $this->class($this->message . "\n\n" . $this->trace); - } catch (Throwable $exception) { // @codeCoverageIgnoreStart + } catch (Throwable $exception) { $throwable = new \Exception($this->message . "\n\n" . $this->trace, 0, $exception); // @codeCoverageIgnoreEnd }