diff --git a/src/Support/Domain.php b/src/Support/Domain.php index b88219b..1b3d1a0 100644 --- a/src/Support/Domain.php +++ b/src/Support/Domain.php @@ -19,7 +19,7 @@ class Domain public readonly DomainNamespaces $namespace; - public function __construct(string $domain, string $subdomain = null) + public function __construct(string $domain, ?string $subdomain = null) { if (is_null($subdomain)) { // If a subdomain isn't explicitly specified, we @@ -62,7 +62,7 @@ protected function getDomainBasePath() return app()->basePath(config('ddd.paths.domains')); } - public function path(string $path = null): string + public function path(?string $path = null): string { if (is_null($path)) { return $this->path; diff --git a/src/ValueObjects/DomainNamespaces.php b/src/ValueObjects/DomainNamespaces.php index 2ca8d4e..b7307bb 100644 --- a/src/ValueObjects/DomainNamespaces.php +++ b/src/ValueObjects/DomainNamespaces.php @@ -15,7 +15,7 @@ public function __construct( ) { } - public static function from(string $domain, string $subdomain = null): self + public static function from(string $domain, ?string $subdomain = null): self { $domainWithSubdomain = str($domain) ->when($subdomain, fn ($domain) => $domain->append("\\{$subdomain}")) diff --git a/tests/Generator/MakeActionTest.php b/tests/Generator/MakeActionTest.php index a0867f7..c5ae16f 100644 --- a/tests/Generator/MakeActionTest.php +++ b/tests/Generator/MakeActionTest.php @@ -87,7 +87,7 @@ expect(file_exists($expectedPath))->toBeTrue(); - expect(file_get_contents($expectedPath))->toContain("class {$name} extends {$baseAction}" . PHP_EOL . '{'); + expect(file_get_contents($expectedPath))->toContain("class {$name} extends {$baseAction}".PHP_EOL.'{'); })->with([ 'BaseAction' => 'BaseAction', 'Base\Action' => 'Base\Action', @@ -113,5 +113,5 @@ Artisan::call("ddd:action {$domain} {$name}"); expect(file_exists($expectedPath))->toBeTrue(); - expect(file_get_contents($expectedPath))->toContain("class {$name}" . PHP_EOL . '{'); + expect(file_get_contents($expectedPath))->toContain("class {$name}".PHP_EOL.'{'); }); diff --git a/tests/Generator/MakeViewModelTest.php b/tests/Generator/MakeViewModelTest.php index 5835229..4105817 100644 --- a/tests/Generator/MakeViewModelTest.php +++ b/tests/Generator/MakeViewModelTest.php @@ -77,7 +77,7 @@ expect(file_exists($expectedPath))->toBeFalse(); // This currently only tests for the default base model - $expectedBaseViewModelPath = base_path(config('ddd.paths.domains') . '/Shared/ViewModels/ViewModel.php'); + $expectedBaseViewModelPath = base_path(config('ddd.paths.domains').'/Shared/ViewModels/ViewModel.php'); if (file_exists($expectedBaseViewModelPath)) { unlink($expectedBaseViewModelPath);