Skip to content

Commit

Permalink
Merge pull request #77 from gazsp/analysis-OMbRbW
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
poing committed May 5, 2020
2 parents 0905639 + ab3da85 commit 204f4b6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
44 changes: 22 additions & 22 deletions src/Baum/Console/ModelMakeCommand.php
Expand Up @@ -48,19 +48,19 @@ public function handle()
// $this->input->setOption('controller', true);
// $this->input->setOption('resource', true);
// }
//
//
// if ($this->option('factory')) {
// $this->createFactory();
// }
//
//
// if ($this->option('migration')) {
// $this->createMigration();
// }
//
//
// if ($this->option('seed')) {
// $this->createSeeder();
// }
//
//
// if ($this->option('controller') || $this->option('resource') || $this->option('api')) {
// $this->createController();
// }
Expand All @@ -74,7 +74,7 @@ public function handle()
// protected function createFactory()
// {
// $factory = Str::studly(class_basename($this->argument('name')));
//
//
// $this->call('make:factory', [
// 'name' => "{$factory}Factory",
// '--model' => $this->qualifyClass($this->getNameInput()),
Expand All @@ -89,11 +89,11 @@ public function handle()
// protected function createMigration()
// {
// $table = Str::snake(Str::pluralStudly(class_basename($this->argument('name'))));
//
// // if ($this->option('pivot')) {
// // $table = Str::singular($table);
// // }
//
//
// // if ($this->option('pivot')) {
// // $table = Str::singular($table);
// // }
//
// $this->call('make:migration', [
// 'name' => "create_{$table}_table",
// '--create' => $table,
Expand All @@ -108,7 +108,7 @@ public function handle()
// protected function createSeeder()
// {
// $seeder = Str::studly(class_basename($this->argument('name')));
//
//
// $this->call('make:seed', [
// 'name' => "{$seeder}Seeder",
// ]);
Expand All @@ -122,9 +122,9 @@ public function handle()
// protected function createController()
// {
// $controller = Str::studly(class_basename($this->argument('name')));
//
//
// $modelName = $this->qualifyClass($this->getNameInput());
//
//
// $this->call('make:controller', array_filter([
// 'name' => "{$controller}Controller",
// '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,
Expand Down Expand Up @@ -156,7 +156,7 @@ protected function resolveStubPath($stub)
// return file_exists($customPath = $this->laravel->basePath(trim($stub, '/')))
// ? $customPath
// : __DIR__.$stub;
return __DIR__ . $stub;
return __DIR__.$stub;
}

/**
Expand All @@ -167,15 +167,15 @@ protected function resolveStubPath($stub)
protected function getOptions()
{
return [
// ['all', 'a', InputOption::VALUE_NONE, 'Generate a migration, seeder, factory, and resource controller for the model'],
// ['controller', 'c', InputOption::VALUE_NONE, 'Create a new controller for the model'],
// ['factory', 'f', InputOption::VALUE_NONE, 'Create a new factory for the model'],
// ['all', 'a', InputOption::VALUE_NONE, 'Generate a migration, seeder, factory, and resource controller for the model'],
// ['controller', 'c', InputOption::VALUE_NONE, 'Create a new controller for the model'],
// ['factory', 'f', InputOption::VALUE_NONE, 'Create a new factory for the model'],
['force', null, InputOption::VALUE_NONE, 'Create the class even if the model already exists'],
// ['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model'],
// ['seed', 's', InputOption::VALUE_NONE, 'Create a new seeder file for the model'],
// ['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model'],
// ['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'],
// ['api', null, InputOption::VALUE_NONE, 'Indicates if the generated controller should be an API controller'],
// ['migration', 'm', InputOption::VALUE_NONE, 'Create a new migration file for the model'],
// ['seed', 's', InputOption::VALUE_NONE, 'Create a new seeder file for the model'],
// ['pivot', 'p', InputOption::VALUE_NONE, 'Indicates if the generated model should be a custom intermediate table model'],
// ['resource', 'r', InputOption::VALUE_NONE, 'Indicates if the generated controller should be a resource controller'],
// ['api', null, InputOption::VALUE_NONE, 'Indicates if the generated controller should be an API controller'],
];
}
}
11 changes: 5 additions & 6 deletions tests/Basic/BasicBaumTest.php
Expand Up @@ -248,16 +248,15 @@ public function getImmediateDescendantsTest()

/** @test */
public function makeBaumTest()
{
$faker = \Faker\Factory::create();
$this->artisan('make:baum ' . $faker->domainWord)
{
$faker = \Faker\Factory::create();

$this->artisan('make:baum '.$faker->domainWord)
->expectsOutput('Model created successfully.')
->assertExitCode(0);

$this->artisan('make:baum ' . $faker->domainWord . ' --force')
$this->artisan('make:baum '.$faker->domainWord.' --force')
->expectsOutput('Model created successfully.')
->assertExitCode(0);

}
}

0 comments on commit 204f4b6

Please sign in to comment.