Skip to content

Commit

Permalink
style: Apply fixes from StyleCI (#943)
Browse files Browse the repository at this point in the history
Co-authored-by: Mitul Golakiya <[email protected]>
  • Loading branch information
mitulgolakiya and mitulgolakiya authored Jan 28, 2021
1 parent df6c386 commit 4cb4bcb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Common/CommandData.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function addDynamicVariable($name, $val)
{
$this->dynamicVars[$name] = $val;
}

public function jqueryDT()
{
return $this->getOption('jqueryDT') ? true : false;
Expand Down
2 changes: 1 addition & 1 deletion src/Common/GeneratorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function loadPaths()
'infyom.laravel_generator.path.views',
resource_path('views/')
).$viewPrefix.$this->mSnakePlural.'/';

$this->pathAssets = config(
'infyom.laravel_generator.path.assets',
resource_path('assets/')
Expand Down
4 changes: 2 additions & 2 deletions src/Generators/Scaffold/ControllerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function generate()
$templateData = get_template("scaffold.controller.$templateName", 'laravel-generator');

$this->generateDataTable();
} else if ($this->commandData->jqueryDT()) {
} elseif ($this->commandData->jqueryDT()) {
$templateName = 'jquery_datatable_controller';
$templateData = get_template("scaffold.controller.$templateName", 'laravel-generator');

Expand Down Expand Up @@ -104,7 +104,7 @@ private function generateDataTable()
$this->commandData->commandComment("\nDataTable created: ");
$this->commandData->commandInfo($fileName);
}

private function generateDataTableColumns()
{
$templateName = 'datatable_column';
Expand Down
4 changes: 2 additions & 2 deletions src/Generators/Scaffold/JQueryDatatableAssetsGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function generateJquery()
$templateData = str_replace('$JQUERY_FIELDS$', $fields, $templateData);

$path = $this->path.$this->config->tableName.'/';
if (! file_exists($path)) {
if (!file_exists($path)) {
FileUtil::createDirectoryIfNotExist($path);
}
file_put_contents($path.$this->fileName, $templateData);
Expand All @@ -78,7 +78,7 @@ public function generateJquery()
$templateData = fill_template($this->commandData->dynamicVars, $templateData);

$path = $this->config->pathViews.'templates/';
if (! file_exists($path)) {
if (!file_exists($path)) {
FileUtil::createDirectoryIfNotExist($path);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Generators/Scaffold/ViewGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ViewGenerator extends BaseGenerator

/** @var array */
private $htmlFields;

public function __construct(CommandData $commandData)
{
$this->commandData = $commandData;
Expand Down Expand Up @@ -122,7 +122,7 @@ private function generateDataTableActions()
private function generateBladeTableBody()
{
$templateName = 'blade_table_body';

$tableFields = $this->generateTableHeaderFields();
if ($this->commandData->jqueryDT()) {
$templateName = 'js_table';
Expand Down Expand Up @@ -160,7 +160,7 @@ private function generateBladeTableBody()

return str_replace('$FIELD_BODY$', $tableBodyFields, $templateData);
}

private function generateJSTableHeaderFields()
{
$fields = '';
Expand All @@ -169,9 +169,9 @@ private function generateJSTableHeaderFields()
continue;
}

$fields .= '<th scope="col">'.str_replace("'", "", $field->name).'</th>';
$fields .= '<th scope="col">'.str_replace("'", '', $field->name).'</th>';
}

return $fields;
}

Expand Down

0 comments on commit 4cb4bcb

Please sign in to comment.