Skip to content

Commit

Permalink
Merge pull request #72 from cjwilburn/master
Browse files Browse the repository at this point in the history
Addressing #68
  • Loading branch information
fernandobritofl authored Apr 11, 2017
2 parents 47cdfd0 + 829fe82 commit d2d3574
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
46 changes: 23 additions & 23 deletions src/Commands/ScaffoldMakeCommand.php
100755 → 100644
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 All @@ -20,7 +20,7 @@

class ScaffoldMakeCommand extends Command
{
use AppNamespaceDetectorTrait, MakerTrait;
use DetectsApplicationNamespace, MakerTrait;

/**
* The console command name!
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
8 changes: 4 additions & 4 deletions src/Makes/MakeController.php
100755 → 100644
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 All @@ -10,7 +10,7 @@

class MakeController
{
use AppNamespaceDetectorTrait, MakerTrait;
use DetectsApplicationNamespace, MakerTrait;

/**
* Store name from Model
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()
// }


}
}
Empty file modified src/Makes/MakeLayout.php
100755 → 100644
Empty file.
Empty file modified src/Makes/MakeLocalization.php
100755 → 100644
Empty file.
Empty file modified src/Makes/MakeMigration.php
100755 → 100644
Empty file.
Empty file modified src/Makes/MakeModel.php
100755 → 100644
Empty file.
6 changes: 3 additions & 3 deletions src/Makes/MakeRoute.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

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;
use Laralib\L5scaffold\Migrations\SyntaxBuilder;

class MakeRoute
{
use AppNamespaceDetectorTrait, MakerTrait;
use DetectsApplicationNamespace, MakerTrait;

/**
* Create a new instance.
Expand Down Expand Up @@ -61,4 +61,4 @@ protected function compileRouteStub()

return $stub;
}
}
}
Empty file modified src/Makes/MakeSeed.php
100755 → 100644
Empty file.
Empty file modified src/Makes/MakeView.php
100755 → 100644
Empty file.
Empty file modified src/Makes/MakerTrait.php
100755 → 100644
Empty file.

0 comments on commit d2d3574

Please sign in to comment.