Skip to content

Commit a676462

Browse files
authored
Merge pull request #11 from pravodev/develop
make command
2 parents 8fa400d + 193969f commit a676462

11 files changed

+44
-37
lines changed

src/Commands/Generators/JobMakeCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
class JobMakeCommand extends BaseJobMakeCommand
99
{
1010
use GeneratorTrait;
11-
11+
1212
/**
1313
* The console command name.
1414
*
1515
* @var string
1616
*/
1717
protected $name = 'laramoud-make:job';
18-
19-
}
18+
}

src/Commands/Generators/MailMakeCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function writeMarkdownTemplate()
2525
{
2626
$path = $this->getModulePath($this->argument('module_name')).'/resources/views/'.str_replace('.', '/', $this->option('markdown')).'.blade.php';
2727

28-
if (! $this->files->isDirectory(dirname($path))) {
28+
if (!$this->files->isDirectory(dirname($path))) {
2929
$this->files->makeDirectory(dirname($path), 0755, true);
3030
}
3131

@@ -34,10 +34,11 @@ protected function writeMarkdownTemplate()
3434
$this->files->put($path, file_get_contents($vendor.'/stubs/markdown.stub'));
3535
}
3636

37-
/**
37+
/**
3838
* Build the class with the given name.
3939
*
40-
* @param string $name
40+
* @param string $name
41+
*
4142
* @return string
4243
*/
4344
protected function buildClass($name)
@@ -47,6 +48,7 @@ protected function buildClass($name)
4748
if ($this->option('markdown')) {
4849
$class = str_replace('DummyView', $this->argument('module_name').'::'.$this->option('markdown'), $class);
4950
}
51+
5052
return $class;
5153
}
5254
}

src/Commands/Generators/MigrateMakeCommand.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<?php
22
/**
33
* This file is part of laramoud package.
4-
*
4+
*
55
* @author Rifqi Khoeruman Azam <pravodev@gmail.com>
6-
*
7-
*
6+
*
7+
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
* Copyright © 2019 PondokIT. All rights reserved.
1111
*/
12+
1213
namespace Pravodev\Laramoud\Commands\Generators;
1314

1415
use Illuminate\Console\Command;
@@ -45,15 +46,15 @@ public function __construct()
4546
public function handle()
4647
{
4748
$this->call('make:migration', [
48-
'name' => $this->argument('name'),
49-
'--create' => $this->option('create'),
50-
'--table' => $this->option('table'),
51-
'--path' => $this->getMigrationPath(),
52-
'--realpath' => $this->option('realpath')
49+
'name' => $this->argument('name'),
50+
'--create' => $this->option('create'),
51+
'--table' => $this->option('table'),
52+
'--path' => $this->getMigrationPath(),
53+
'--realpath' => $this->option('realpath'),
5354
]);
5455
}
5556

56-
/**
57+
/**
5758
* Get migration path (either specified by '--path' option or default location).
5859
*
5960
* @return string
@@ -62,6 +63,7 @@ protected function getMigrationPath()
6263
{
6364
$path = $this->option('path') ?: '/database/migrations';
6465
$module_path = $this->getConfig('module_path', 'composer') ?: 'modules/';
66+
6567
return $module_path.$this->argument('module_name').$path;
6668
}
6769
}

src/Commands/Generators/ModelMakeCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
namespace Pravodev\Laramoud\Commands\Generators;
44

55
use Illuminate\Foundation\Console\ModelMakeCommand as BaseModelMakeCommand;
6-
use Pravodev\Laramoud\Contracts\GeneratorTrait;
76
use Illuminate\Support\Str;
7+
use Pravodev\Laramoud\Contracts\GeneratorTrait;
88

99
class ModelMakeCommand extends BaseModelMakeCommand
1010
{
1111
use GeneratorTrait;
12-
12+
1313
/**
1414
* The console command name.
1515
*
@@ -27,7 +27,7 @@ protected function createFactory()
2727
$factory = Str::studly(class_basename($this->argument('name')));
2828

2929
$this->call('laramoud-make:factory', [
30-
'name' => "{$factory}Factory",
30+
'name' => "{$factory}Factory",
3131
'--model' => $this->qualifyClass($this->getNameInput()),
3232
]);
3333
}
@@ -46,7 +46,7 @@ protected function createMigration()
4646
}
4747

4848
$this->call('laramoud-make:migration', [
49-
'name' => "create_{$table}_table",
49+
'name' => "create_{$table}_table",
5050
'--create' => $table,
5151
]);
5252
}
@@ -63,7 +63,7 @@ protected function createController()
6363
$modelName = $this->qualifyClass($this->getNameInput());
6464

6565
$this->call('laramoud-make:controller', [
66-
'name' => "{$controller}Controller",
66+
'name' => "{$controller}Controller",
6767
'--model' => $this->option('resource') ? $modelName : null,
6868
]);
6969
}

src/Commands/Generators/NotificationMakeCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class NotificationMakeCommand extends BaseNotificationMakeCommand
1616
*/
1717
protected $name = 'laramoud-make:notification';
1818

19-
/**
19+
/**
2020
* Write the Markdown template for the mailable.
2121
*
2222
* @return void
@@ -25,7 +25,7 @@ protected function writeMarkdownTemplate()
2525
{
2626
$path = $this->getModulePath($this->argument('module_name')).'/resources/views/'.str_replace('.', '/', $this->option('markdown')).'.blade.php';
2727

28-
if (! $this->files->isDirectory(dirname($path))) {
28+
if (!$this->files->isDirectory(dirname($path))) {
2929
$this->files->makeDirectory(dirname($path), 0755, true);
3030
}
3131

@@ -35,7 +35,8 @@ protected function writeMarkdownTemplate()
3535
/**
3636
* Build the class with the given name.
3737
*
38-
* @param string $name
38+
* @param string $name
39+
*
3940
* @return string
4041
*/
4142
protected function buildClass($name)

src/Commands/Generators/ObserverMakeCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Pravodev\Laramoud\Commands\Generators;
44

55
use Illuminate\Foundation\Console\ObserverMakeCommand as BaseObserverMakeCommand;
6-
use Pravodev\Laramoud\Contracts\GeneratorTrait;
76
use Illuminate\Support\Str;
7+
use Pravodev\Laramoud\Contracts\GeneratorTrait;
88

99
class ObserverMakeCommand extends BaseObserverMakeCommand
1010
{
@@ -20,8 +20,9 @@ class ObserverMakeCommand extends BaseObserverMakeCommand
2020
/**
2121
* Replace the model for the given stub.
2222
*
23-
* @param string $stub
24-
* @param string $model
23+
* @param string $stub
24+
* @param string $model
25+
*
2526
* @return string
2627
*/
2728
protected function replaceModel($stub, $model)

src/Commands/Generators/PolicyMakeCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace Pravodev\Laramoud\Commands\Generators;
44

55
use Illuminate\Foundation\Console\PolicyMakeCommand as BasePolicyMakeCommand;
6-
use Pravodev\Laramoud\Contracts\GeneratorTrait;
76
use Illuminate\Support\Str;
7+
use Pravodev\Laramoud\Contracts\GeneratorTrait;
88

99
class PolicyMakeCommand extends BasePolicyMakeCommand
1010
{
@@ -20,8 +20,9 @@ class PolicyMakeCommand extends BasePolicyMakeCommand
2020
/**
2121
* Replace the model for the given stub.
2222
*
23-
* @param string $stub
24-
* @param string $model
23+
* @param string $stub
24+
* @param string $model
25+
*
2526
* @return string
2627
*/
2728
protected function replaceModel($stub, $model)

src/Commands/Generators/ResourceMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class ResourceMakeCommand extends BaseResourceMakeCommand
99
{
1010
use GeneratorTrait;
11-
11+
1212
/**
1313
* The console command name.
1414
*

src/Commands/Generators/RuleMakeCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
class RuleMakeCommand extends BaseRuleMakeCommand
99
{
1010
use GeneratorTrait;
11-
1211

1312
/**
1413
* The console command name.

src/Commands/Generators/SeederMakeCommand.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
namespace Pravodev\Laramoud\Commands\Generators;
44

55
use Illuminate\Database\Console\Seeds\SeederMakeCommand as BaseSeederMakeCommand;
6-
use Pravodev\Laramoud\Contracts\GeneratorTrait;
76
use Illuminate\Filesystem\Filesystem;
8-
use \Illuminate\Support\Composer;
7+
use Illuminate\Support\Composer;
8+
use Pravodev\Laramoud\Contracts\GeneratorTrait;
99

1010
class SeederMakeCommand extends BaseSeederMakeCommand
1111
{
@@ -17,7 +17,7 @@ public function __construct(Filesystem $files, Composer $composer)
1717
$this->cacheInit();
1818
$this->composer = $composer;
1919
}
20-
20+
2121
/**
2222
* The console command name.
2323
*
@@ -28,7 +28,8 @@ public function __construct(Filesystem $files, Composer $composer)
2828
/**
2929
* Get the destination class path.
3030
*
31-
* @param string $name
31+
* @param string $name
32+
*
3233
* @return string
3334
*/
3435
protected function getPath($name)

0 commit comments

Comments
 (0)