Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Fix bugs #48

Merged
merged 2 commits into from
Feb 3, 2025
Merged
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
4 changes: 2 additions & 2 deletions src/Stubs/module/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace {{ $NAMESPACE$ }};

use Illuminate\Http\Request;
use {{ }} as Controller;
use {{ $EXTEND_CONTROLLER$ }} as Controller;

class {{ $CLASS_NAME$ }} extends Controller
{
//
// Milwad Khosravi
}
2 changes: 1 addition & 1 deletion src/Stubs/repository.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace {{ $NAMESPACE$ }};

class {{ $CLASS_NAME$ }}
{

// Milwad Khosravi
}
2 changes: 1 addition & 1 deletion src/Stubs/service.stub
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ namespace {{ $NAMESPACE$ }};

class {{ $CLASS_NAME$ }}
{

// Milwad Khosravi
}
18 changes: 6 additions & 12 deletions src/Traits/CommonTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ trait CommonTrait
{
/**
* Show extra option in CLI.
*
* @return array|string
*/
private function extraOption(): string|array
{
Expand All @@ -18,32 +16,28 @@ private function extraOption(): string|array

/**
* Extra option operation.
*
* @param string $name_uc
*
* @return void
*/
public function extraOptionOperation(string $name_uc)
public function extraOptionOperation(string $name_uc): void
{
$selectOption = $this->extraOption();

if (OptionData::$options[$selectOption] === OptionData::SEEDER_OPTION) {
if ($selectOption === OptionData::SEEDER_OPTION) {
$this->makeSeeder($name_uc);
$this->extraOptionOperation($name_uc);
}
if (OptionData::$options[$selectOption] === OptionData::FACTORY_OPTION) {
if ($selectOption === OptionData::FACTORY_OPTION) {
$this->makeFactory($name_uc);
$this->extraOptionOperation($name_uc);
}
if (OptionData::$options[$selectOption] === OptionData::REPOSITORY_OPTION) {
if ($selectOption === OptionData::REPOSITORY_OPTION) {
$this->makeRepository($name_uc);
$this->extraOptionOperation($name_uc);
}
if (OptionData::$options[$selectOption] === OptionData::SERVICE_OPTION) {
if ($selectOption === OptionData::SERVICE_OPTION) {
$this->makeService($name_uc);
$this->extraOptionOperation($name_uc);
}
if (OptionData::$options[$selectOption] === OptionData::TEST_OPTION) {
if ($selectOption === OptionData::TEST_OPTION) {
$this->makeTest($name_uc);
$this->extraOptionOperation($name_uc);
}
Expand Down
Loading