Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey authored and github-actions[bot] committed Nov 9, 2024
1 parent 4491db7 commit 4e761f7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/Commands/Concerns/HasDomainStubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function resolvePublishedDddStub($path)
->toString();

// Check if there is a user-published stub
if (file_exists($publishedPath = app()->basePath('stubs/ddd/' . $stubFilename))) {
if (file_exists($publishedPath = app()->basePath('stubs/ddd/'.$stubFilename))) {
return $publishedPath;
}

Expand All @@ -61,10 +61,10 @@ protected function resolveDddStubPath($path)
->ltrim('/\\')
->toString();

if($publishedPath = $this->resolvePublishedDddStub($path)) {
if ($publishedPath = $this->resolvePublishedDddStub($path)) {
return $publishedPath;
}

return DDD::packagePath('stubs/' . $path);
return DDD::packagePath('stubs/'.$path);
}
}
2 changes: 1 addition & 1 deletion src/Commands/DomainControllerMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function buildClass($name)
{
$stub = parent::buildClass($name);

if($this->isUsingPublishedStub()){
if ($this->isUsingPublishedStub()) {
return $stub;
}

Expand Down
12 changes: 6 additions & 6 deletions tests/Generator/ControllerMakeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@

expect($output = Artisan::output())->when(
Feature::IncludeFilepathInGeneratorCommandOutput->exists(),
fn($output) => $output->toContainFilepath($relativePath),
fn ($output) => $output->toContainFilepath($relativePath),
);

expect(file_exists($expectedPath))->toBeTrue();

expect(file_get_contents($expectedPath))
->toContain("namespace {$expectedNamespace};")
->toContain("use App\Http\Controllers\Controller;")
->toContain("extends Controller");
->toContain('extends Controller');
})->with([
'Invoicing:InvoiceController' => [
'Invoicing',
Expand Down Expand Up @@ -205,7 +205,7 @@
expect(file_get_contents($expectedPath))
->toContain("namespace {$expectedNamespace};")
->not->toContain("use App\Http\Controllers\Controller;")
->not->toContain("extends Controller");
->not->toContain('extends Controller');

// Reset the application skeleton
$this->setupTestApplication();
Expand Down Expand Up @@ -234,7 +234,7 @@
expect(file_exists($baseControllerPath))->toBeTrue();

// Publish a custom controller.stub
$customStub = <<<STUB
$customStub = <<<'STUB'
<?php
namespace {{ namespace }};
Expand All @@ -255,9 +255,9 @@ class {{ class }}

expect(file_get_contents($expectedPath))
->toContain("namespace {$expectedNamespace};")
->toContain("use CustomControllerTrait;")
->toContain('use CustomControllerTrait;')
->not->toContain("use App\Http\Controllers\Controller;")
->not->toContain("extends Controller");
->not->toContain('extends Controller');

$this->cleanStubs();
})->with([
Expand Down
14 changes: 7 additions & 7 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function setUp(): void
// );

Factory::guessFactoryNamesUsing(
fn(string $modelName) => 'Lunarstorm\\LaravelDDD\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
fn (string $modelName) => 'Lunarstorm\\LaravelDDD\\Database\\Factories\\'.class_basename($modelName).'Factory'
);
});

Expand Down Expand Up @@ -140,7 +140,7 @@ protected function composerReload()

protected function cleanSlate()
{
File::copy(__DIR__ . '/.skeleton/composer.json', base_path('composer.json'));
File::copy(__DIR__.'/.skeleton/composer.json', base_path('composer.json'));

File::delete(base_path('config/ddd.php'));

Expand All @@ -165,10 +165,10 @@ protected function cleanStubs()

protected function setupTestApplication()
{
File::copyDirectory(__DIR__ . '/.skeleton/app', app_path());
File::copyDirectory(__DIR__ . '/.skeleton/database', base_path('database'));
File::copyDirectory(__DIR__ . '/.skeleton/src/Domain', base_path('src/Domain'));
File::copy(__DIR__ . '/.skeleton/bootstrap/providers.php', base_path('bootstrap/providers.php'));
File::copyDirectory(__DIR__.'/.skeleton/app', app_path());
File::copyDirectory(__DIR__.'/.skeleton/database', base_path('database'));
File::copyDirectory(__DIR__.'/.skeleton/src/Domain', base_path('src/Domain'));
File::copy(__DIR__.'/.skeleton/bootstrap/providers.php', base_path('bootstrap/providers.php'));
File::ensureDirectoryExists(app_path('Models'));

$this->setDomainPathInComposer('Domain', 'src/Domain');
Expand All @@ -178,7 +178,7 @@ protected function setDomainPathInComposer($domainNamespace, $domainPath, bool $
{
$this->updateComposer(
set: [
[['autoload', 'psr-4', $domainNamespace . '\\'], $domainPath],
[['autoload', 'psr-4', $domainNamespace.'\\'], $domainPath],
],
);

Expand Down

0 comments on commit 4e761f7

Please sign in to comment.