diff --git a/src/Concerns/InteractsWithTestCase.php b/src/Concerns/InteractsWithTestCase.php index 53ce3597..4e79fd69 100644 --- a/src/Concerns/InteractsWithTestCase.php +++ b/src/Concerns/InteractsWithTestCase.php @@ -107,9 +107,6 @@ public static function usesTestingFeature($attribute, int $flag = Attribute::TAR return; } - /** @var class-string $name */ - $name = \get_class($attribute); - if ($flag & Attribute::TARGET_CLASS) { static::$testCaseTestingFeatures[] = [ 'key' => $attribute::class, diff --git a/src/PHPUnit/AttributeParser.php b/src/PHPUnit/AttributeParser.php index 12580b9b..7b8ce514 100644 --- a/src/PHPUnit/AttributeParser.php +++ b/src/PHPUnit/AttributeParser.php @@ -122,10 +122,7 @@ protected static function resolveAttribute(ReflectionAttribute $attribute): arra return [null, null]; } - /** @var class-string $name */ - $name = \get_class($instance); - - return [$name, $instance]; + return [$instance::class, $instance]; }, [null, null], false); } } diff --git a/src/Workbench/Workbench.php b/src/Workbench/Workbench.php index b6ec144c..f0b848aa 100644 --- a/src/Workbench/Workbench.php +++ b/src/Workbench/Workbench.php @@ -197,7 +197,7 @@ public static function discoverRoutes(ApplicationContract $app, ConfigContract $ $factoryNamespace = static::detectNamespace('database/factories') ?? 'Workbench\\Database\\Factories\\'; $namespacedFactoryBasename = Str::replaceLast( - 'Factory', '', Str::replaceFirst($factoryNamespace, '', \get_class($factory)) + 'Factory', '', Str::replaceFirst($factoryNamespace, '', $factory::class) ); $factoryBasename = Str::replaceLast('Factory', '', class_basename($factory));