Skip to content

Commit

Permalink
addresses laralib#68 in laralib/l5scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
cjwilburn committed Feb 21, 2017
1 parent 47cdfd0 commit c09ef85
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
44 changes: 22 additions & 22 deletions src/Commands/ScaffoldMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Laralib\L5scaffold\Commands;

use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Console\DetectsApplicationNamespace;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Input;
Expand Down Expand Up @@ -77,7 +77,7 @@ public function __construct(Filesystem $files)
* @return void
*/
public function fire()
{
{
$header = "scaffolding: {$this->getObjName("Name")}";
$footer = str_pad('', strlen($header), '-');
$dump = str_pad('>DUMP AUTOLOAD<', strlen($header), ' ', STR_PAD_BOTH);
Expand Down Expand Up @@ -105,23 +105,23 @@ public function fire()
*
* @return void
*/
protected function makeMeta()
protected function makeMeta()
{
// ToDo - Verificar utilidade...
$this->meta['action'] = 'create';
$this->meta['var_name'] = $this->getObjName("name");
$this->meta['table'] = $this->getObjName("names");//obsoleto

$this->meta['ui'] = $this->option('ui');

$this->meta['namespace'] = $this->getAppNamespace();

$this->meta['Model'] = $this->getObjName('Name');
$this->meta['Models'] = $this->getObjName('Names');
$this->meta['model'] = $this->getObjName('name');
$this->meta['models'] = $this->getObjName('names');
$this->meta['ModelMigration'] = "Create{$this->meta['Models']}Table";

$this->meta['schema'] = $this->option('schema');
$this->meta['prefix'] = ($prefix = $this->option('prefix')) ? "$prefix." : "";
}
Expand All @@ -145,7 +145,7 @@ private function makeController()
{
new MakeController($this, $this->files);
}

/**
* Make a layout.blade.php with bootstrap
*
Expand Down Expand Up @@ -202,7 +202,7 @@ private function makeLocalization()
*/
protected function getArguments()
{
return
return
[
['name', InputArgument::REQUIRED, 'The name of the model. (Ex: Post)'],
];
Expand All @@ -215,13 +215,13 @@ protected function getArguments()
*/
protected function getOptions()
{
return
return
[
[
'schema',
's',
InputOption::VALUE_REQUIRED,
'Schema to generate scaffold files. (Ex: --schema="title:string")',
'schema',
's',
InputOption::VALUE_REQUIRED,
'Schema to generate scaffold files. (Ex: --schema="title:string")',
null
],
[
Expand Down Expand Up @@ -253,17 +253,17 @@ protected function getOptions()
null,
],
[
'form',
'f',
InputOption::VALUE_OPTIONAL,
'Use Illumintate/Html Form facade to generate input fields',
'form',
'f',
InputOption::VALUE_OPTIONAL,
'Use Illumintate/Html Form facade to generate input fields',
false
],
[
'prefix',
'p',
InputOption::VALUE_OPTIONAL,
'Generate schema with prefix',
'prefix',
'p',
InputOption::VALUE_OPTIONAL,
'Generate schema with prefix',
false
]
];
Expand Down Expand Up @@ -301,7 +301,7 @@ public function getObjName($config = 'Name')
$names['name'] = str_singular(strtolower(preg_replace('/(?<!^)([A-Z])/', '_$1', $args_name)));


if (!isset($names[$config]))
if (!isset($names[$config]))
{
throw new \Exception("Position name is not found");
};
Expand Down
6 changes: 3 additions & 3 deletions src/Makes/MakeController.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
namespace Laralib\L5scaffold\Makes;

use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Console\DetectsApplicationNamespace;
use Illuminate\Filesystem\Filesystem;
use Laralib\L5scaffold\Commands\ScaffoldMakeCommand;
use Laralib\L5scaffold\Validators\SchemaParser as ValidatorParser;
Expand Down Expand Up @@ -44,7 +44,7 @@ private function start()
$name = $this->scaffoldCommandObj->getObjName('Name') . 'Controller';
$path = $this->getPath($name, 'controller');

if ($this->files->exists($path))
if ($this->files->exists($path))
{
return $this->scaffoldCommandObj->comment("x $name");
}
Expand Down Expand Up @@ -90,4 +90,4 @@ protected function compileControllerStub()
// }


}
}
4 changes: 2 additions & 2 deletions src/Makes/MakeRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Laralib\L5scaffold\Makes;

use Illuminate\Console\AppNamespaceDetectorTrait;
use Illuminate\Console\DetectsApplicationNamespace;
use Illuminate\Filesystem\Filesystem;
use Laralib\L5scaffold\Commands\ScaffoldMakeCommand;
use Laralib\L5scaffold\Migrations\SchemaParser;
Expand Down Expand Up @@ -61,4 +61,4 @@ protected function compileRouteStub()

return $stub;
}
}
}

0 comments on commit c09ef85

Please sign in to comment.