Correction of many errors code inspection.

Adjustments code according to the standards.
Adding missing PHPDoc comment.
This commit is contained in:
Thiago Talma
2014-04-16 19:29:07 -03:00
parent 664d2aa007
commit c1445871f4
24 changed files with 127 additions and 61 deletions

View File

@ -89,8 +89,9 @@ class FixtureController extends Controller
}
if (!$foundFixtures) {
throw new Exception("No files were found by name: \"" . implode(', ', $fixtures) . "\".\n"
. "Check that files with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
throw new Exception(
"No files were found by name: \"" . implode(', ', $fixtures) . "\".\n" .
"Check that files with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
);
}
@ -131,8 +132,9 @@ class FixtureController extends Controller
}
if (!$foundFixtures) {
throw new Exception("No files were found by name: \"" . implode(', ', $fixtures) . "\".\n"
. "Check that fixtures with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
throw new Exception(
"No files were found by name: \"" . implode(', ', $fixtures) . "\".\n" .
"Check that fixtures with these name exists, under fixtures path: \n\"" . $this->getFixturePath() . "\"."
);
}

View File

@ -221,7 +221,7 @@ class MessageController extends Controller
} else {
$last_id = $db->getLastInsertID();
$db->createCommand()
->update(
->update(
$sourceMessageTable,
['message' => new \yii\db\Expression("CONCAT('@@',message,'@@')")],
['in', 'id', $obsolete]
@ -253,7 +253,10 @@ class MessageController extends Controller
foreach ($translator as $currentTranslator) {
$n = preg_match_all(
'/\b' . $currentTranslator . '\s*\(\s*(\'.*?(?<!\\\\)\'|".*?(?<!\\\\)")\s*,\s*(\'.*?(?<!\\\\)\'|".*?(?<!\\\\)")\s*[,\)]/s',
$subject, $matches, PREG_SET_ORDER);
$subject,
$matches,
PREG_SET_ORDER
);
for ($i = 0; $i < $n; ++$i) {
if (($pos = strpos($matches[$i][1], '.')) !== false) {
$category = substr($matches[$i][1], $pos + 1, -1);

View File

@ -95,7 +95,8 @@ class MigrateController extends Controller
*/
public function options($actionId)
{
return array_merge(parent::options($actionId),
return array_merge(
parent::options($actionId),
['migrationPath', 'migrationTable', 'db'], // global for all actions
($actionId == 'create') ? ['templateFile'] : [] // action create
);