Skip to content

Commit

Permalink
Add early return to save some tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Mar 19, 2014
1 parent eac89bf commit 5e7f1ff
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/Console/Command/Task/FixtureTask.php
Expand Up @@ -315,21 +315,22 @@ protected function _generateSchema($table) {
* @return array Formatted values
*/
protected function _values($values) {
$vals = array();
if (is_array($values)) {
foreach ($values as $key => $val) {
if (is_array($val)) {
$vals[] = "'{$key}' => array(" . implode(", ", $this->_values($val)) . ")";
$vals = [];
if (!is_array($values)) {
return $vals;
}
foreach ($values as $key => $val) {
if (is_array($val)) {
$vals[] = "'{$key}' => array(" . implode(", ", $this->_values($val)) . ")";
} else {
$val = var_export($val, true);
if ($val === 'NULL') {
$val = 'null';
}
if (!is_numeric($key)) {
$vals[] = "'{$key}' => {$val}";
} else {
$val = var_export($val, true);
if ($val === 'NULL') {
$val = 'null';
}
if (!is_numeric($key)) {
$vals[] = "'{$key}' => {$val}";
} else {
$vals[] = "{$val}";
}
$vals[] = "{$val}";
}
}
}
Expand Down Expand Up @@ -445,7 +446,6 @@ protected function _getRecordsFromTable($modelName, $useTable = null) {
}
$records = $model->find('all', [
'conditions' => $conditions,
'recursive' => -1,
'limit' => $recordCount
]);

Expand Down

0 comments on commit 5e7f1ff

Please sign in to comment.