Skip to content

Commit

Permalink
Added fixes to issues that are raised by Scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
rougin committed Dec 1, 2015
1 parent e0f6d8a commit 4c742c6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/Common/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Rougin\Combustor\Common;

use Twig_Environment;
use Rougin\Describe\Describe;
use Symfony\Component\Console\Command\Command;
use Twig_Environment;

/**
* Abstract Command
Expand Down
2 changes: 1 addition & 1 deletion src/Common/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function putContents($content)
* @param integer $mode
* @return boolean
*/
public function chmod(int $mode)
public function chmod($mode)
{
return chmod($this->path, $mode);
}
Expand Down
24 changes: 11 additions & 13 deletions src/Generator/ModelGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,17 @@ public function generate()
$accessor = 'get_'.$field;
$mutator = 'set_'.$field;

if ($this->data['isCamel']) {
$this->data['camel'][$field] = array(
'field' => lcfirst(camelize($field)),
'accessor' => lcfirst(camelize($accessor)),
'mutator' => lcfirst(camelize($mutator))
);
} else {
$this->data['underscore'][$field] = array(
'field' => lcfirst(underscore($field)),
'accessor' => lcfirst(underscore($accessor)),
'mutator' => lcfirst(underscore($mutator))
);
}
$this->data['camel'][$field] = [
'field' => lcfirst(camelize($field)),
'accessor' => lcfirst(camelize($accessor)),
'mutator' => lcfirst(camelize($mutator))
];

$this->data['underscore'][$field] = [
'field' => lcfirst(underscore($field)),
'accessor' => lcfirst(underscore($accessor)),
'mutator' => lcfirst(underscore($mutator))
];

if ($column->isForeignKey()) {
$field = $column->getField();
Expand Down
24 changes: 11 additions & 13 deletions src/Generator/ViewGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,17 @@ public function generate()
$accessor = 'get_'.$field;
$mutator = 'set_'.$field;

if ($this->data['isCamel']) {
$this->data['camel'][$field] = array(
'field' => lcfirst(camelize($field)),
'accessor' => lcfirst(camelize($accessor)),
'mutator' => lcfirst(camelize($mutator))
);
} else {
$this->data['underscore'][$field] = array(
'field' => lcfirst(underscore($field)),
'accessor' => lcfirst(underscore($accessor)),
'mutator' => lcfirst(underscore($mutator))
);
}
$this->data['camel'][$field] = [
'field' => lcfirst(camelize($field)),
'accessor' => lcfirst(camelize($accessor)),
'mutator' => lcfirst(camelize($mutator))
];

$this->data['underscore'][$field] = [
'field' => lcfirst(underscore($field)),
'accessor' => lcfirst(underscore($accessor)),
'mutator' => lcfirst(underscore($mutator))
];

if ($column->isForeignKey()) {
$referencedTable = Tools::stripTableSchema(
Expand Down

0 comments on commit 4c742c6

Please sign in to comment.