diff --git a/src/helpers.php b/src/helpers.php index b30776b..e5bde07 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -2,10 +2,9 @@ declare(strict_types=1); -use TypeError; use Rayblair\ArrayType\Type; -if (!function_exists('type')) { +if (! function_exists('type')) { /** * Validates that the provided variable matches the expected type. * @@ -20,7 +19,7 @@ function type(mixed $variable, string $type): mixed { // Check if the variable is an object and ensure it's an instance of the expected class if (is_object($variable)) { - if (!$variable instanceof $type) { + if (! $variable instanceof $type) { $actualType = get_class($variable); throw new TypeError("Expected instance of {$type}, instance of {$actualType} given."); @@ -41,7 +40,7 @@ function type(mixed $variable, string $type): mixed }; // If the type check fails, throw a TypeError - if (!$check) { + if (! $check) { $actualType = gettype($variable); throw new TypeError("Expected type {$type}, {$actualType} given."); diff --git a/tests/TypeTest.php b/tests/TypeTest.php index 1a7340b..a9beb93 100644 --- a/tests/TypeTest.php +++ b/tests/TypeTest.php @@ -2,13 +2,11 @@ namespace Rayblair\ArrayType\Tests; -use stdClass; -use TypeError; -use ArgumentCountError; -use Rayblair\ArrayType\Type; use PHPUnit\Framework\TestCase; use Rayblair\ArrayType\Tests\Classes\FooType; -use Rayblair\ArrayType\Tests\Classes\FooArrayType; +use Rayblair\ArrayType\Type; +use stdClass; +use TypeError; class TypeTest extends TestCase {