Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed the use statement to not make static analysis trip over #19

Merged
merged 1 commit into from Dec 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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