Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Console/EnumMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function getDefaultNamespace($rootNamespace)
return match (true) {
is_dir(app_path('Enums')) => $rootNamespace.'\\Enums',
is_dir(app_path('Enumerations')) => $rootNamespace.'\\Enumerations',
default => $rootNamespace,
default => $rootNamespace.'\\Enums',
Comment on lines 73 to +75
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't is_dir(app_path('Enums')) and default now redundant?

};
}

Expand Down
12 changes: 6 additions & 6 deletions tests/Integration/Generators/EnumMakeCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public function testItCanGenerateEnumFile()
->assertExitCode(0);

$this->assertFileContains([
'namespace App;',
'namespace App\Enums;',
'enum StatusEnum',
], 'app/StatusEnum.php');
], 'app/Enums/StatusEnum.php');
}

public function testItCanGenerateEnumFileWithString()
Expand All @@ -30,9 +30,9 @@ public function testItCanGenerateEnumFileWithString()
->assertExitCode(0);

$this->assertFileContains([
'namespace App;',
'namespace App\Enums;',
'enum StringEnum: string',
], 'app/StringEnum.php');
], 'app/Enums/StringEnum.php');
}

public function testItCanGenerateEnumFileWithInt()
Expand All @@ -41,9 +41,9 @@ public function testItCanGenerateEnumFileWithInt()
->assertExitCode(0);

$this->assertFileContains([
'namespace App;',
'namespace App\Enums;',
'enum IntEnum: int',
], 'app/IntEnum.php');
], 'app/Enums/IntEnum.php');
}

public function testItCanGenerateEnumFileInEnumsFolder()
Expand Down