diff --git a/src/Support/DomainAutoloader.php b/src/Support/DomainAutoloader.php index 116a4c1..025f328 100644 --- a/src/Support/DomainAutoloader.php +++ b/src/Support/DomainAutoloader.php @@ -28,7 +28,7 @@ public function __construct() public function autoload(): void { - if (!config()->has('ddd.autoload')) { + if (! config()->has('ddd.autoload')) { return; } @@ -99,10 +99,10 @@ protected function handlePolicies(): void return Arr::wrap(Collection::times(count($classDirnameSegments), function ($index) use ($class, $classDirnameSegments) { $classDirname = implode('\\', array_slice($classDirnameSegments, 0, $index)); - return $classDirname . '\\Policies\\' . class_basename($class) . 'Policy'; + return $classDirname.'\\Policies\\'.class_basename($class).'Policy'; })->reverse()->values()->first(function ($class) { return class_exists($class); - }) ?: [$classDirname . '\\Policies\\' . class_basename($class) . 'Policy']); + }) ?: [$classDirname.'\\Policies\\'.class_basename($class).'Policy']); }); } @@ -115,11 +115,11 @@ protected function handleFactories(): void $appNamespace = static::appNamespace(); - $modelName = Str::startsWith($modelName, $appNamespace . 'Models\\') - ? Str::after($modelName, $appNamespace . 'Models\\') + $modelName = Str::startsWith($modelName, $appNamespace.'Models\\') + ? Str::after($modelName, $appNamespace.'Models\\') : Str::after($modelName, $appNamespace); - return 'Database\\Factories\\' . $modelName . 'Factory'; + return 'Database\\Factories\\'.$modelName.'Factory'; }); }