Skip to content

Commit

Permalink
Removed the use statement to not make static analysis trip over (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rockylars committed Dec 18, 2021
1 parent ef4a270 commit 6d61c8d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Codeception/Module/Asserts.php
Expand Up @@ -4,8 +4,6 @@

namespace Codeception\Module;

use Throwable;

/**
* Special module for using asserts in your tests.
*/
Expand Down Expand Up @@ -34,7 +32,7 @@ class Asserts extends AbstractAsserts
* });
* ```
*
* @param Throwable|string $throwable
* @param \Throwable|string $throwable
*/
public function expectThrowable($throwable, callable $callback): void
{
Expand All @@ -50,7 +48,7 @@ public function expectThrowable($throwable, callable $callback): void

try {
$callback();
} catch (Throwable $t) {
} catch (\Throwable $t) {
$this->checkThrowable($t, $class, $msg, $code);
return;
}
Expand All @@ -62,7 +60,7 @@ public function expectThrowable($throwable, callable $callback): void
* Check if the given throwable matches the expected data,
* fail (throws an exception) if it does not.
*/
protected function checkThrowable(Throwable $throwable, string $expectedClass, ?string $expectedMsg, ?int $expectedCode): void
protected function checkThrowable(\Throwable $throwable, string $expectedClass, ?string $expectedMsg, ?int $expectedCode): void
{
if (!($throwable instanceof $expectedClass)) {
$this->fail(sprintf(
Expand Down

0 comments on commit 6d61c8d

Please sign in to comment.