Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
JasperTey committed Mar 11, 2024
1 parent 552a9f3 commit 09e44c0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Support/Domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/ValueObjects/DomainNamespaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}"))
Expand Down
4 changes: 2 additions & 2 deletions tests/Generator/MakeActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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.'{');
});
2 changes: 1 addition & 1 deletion tests/Generator/MakeViewModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 09e44c0

Please sign in to comment.