Skip to content

Commit

Permalink
Add console option parser command. Correct some sentences and cs issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Oct 10, 2013
1 parent 3886254 commit 24b8f35
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions Cake/Console/Command/UpgradeShell.php
Expand Up @@ -53,7 +53,7 @@ public function startup() {
}

/**
* Run all upgrade steps one at a time
* Run all upgrade steps one at a time.
*
* @return void
*/
Expand All @@ -69,7 +69,7 @@ public function all() {
}

/**
* Move files and folders to their new homes
* Move files and folders to their new homes.
*
* @return void
*/
Expand Down Expand Up @@ -201,7 +201,7 @@ public function app_uses() {
}

/**
* Replace all the App::uses() calls with `use`
* Replace all the App::uses() calls with `use`.
*
* @param string $file The file to search and replace.
* @param boolean $dryRun Whether or not to do the thing.
Expand Down Expand Up @@ -351,7 +351,7 @@ protected function _processFixture($content) {
}
foreach ($values as $key => $val) {
if (is_array($val)) {
$vals[] = "'{$key}' => [" . implode(", ", $export($val)) . "]";
$vals[] = "'{$key}' => [" . implode(', ', $export($val)) . ']';
} else {
$val = var_export($val, true);
if ($val === 'NULL') {
Expand Down Expand Up @@ -453,22 +453,22 @@ public function rename_collections() {
[
'Rename ComponentCollection',
'#ComponentCollection#',
"ComponentRegistry",
'ComponentRegistry',
],
[
'Rename HelperCollection',
'#HelperCollection#',
"HelperRegistry",
'HelperRegistry',
],
[
'Rename TaskCollection',
'#TaskCollection#',
"TaskRegistry",
'TaskRegistry',
],
];
$this->_updateFileRegexp($filePath, $patterns);
}
$this->out(__d('cake_console', '<success>Collection class uses rename successfully.</success>'));
$this->out(__d('cake_console', '<success>Collection class uses renamed successfully.</success>'));
}

/**
Expand Down Expand Up @@ -532,11 +532,11 @@ public function tests() {
];
$this->_updateFileRegexp($filePath, $patterns);
}
$this->out(__d('cake_console', '<success>Collection class uses rename successfully.</success>'));
$this->out(__d('cake_console', '<success>Assertion methods renamed successfully.</success>'));
}

/**
* Filter paths to remove webroot, Plugin, tmp directories
* Filter paths to remove webroot, Plugin, tmp directories.
*
* @return array
*/
Expand Down Expand Up @@ -566,7 +566,7 @@ protected function _addNamespace($path, $filePath, $ns, $dry) {
if (preg_match('/namespace\s+[a-z0-9\\\]+;/', $contents)) {
$this->out(__d(
'cake_console',
"<warning>Skipping %s as it already has a namespace.</warning>",
'<warning>Skipping %s as it already has a namespace.</warning>',
$shortPath
));
return;
Expand Down Expand Up @@ -653,7 +653,7 @@ protected function _getPath() {
}

/**
* get the option parser
* Get the option parser.
*
* @return ConsoleOptionParser
*/
Expand Down Expand Up @@ -712,7 +712,11 @@ public function getOptionParser() {
'parser' => ['options' => compact('plugin', 'dryRun'), 'arguments' => compact('path')],
])
->addSubcommand('rename_collections', [
'help' => __d('cake_console', "Rename HelperCollection, ComponentCollection, and TaskCollection. Will also rename component constructor arguments and _Collection properties on all objects."),
'help' => __d('cake_console', 'Rename HelperCollection, ComponentCollection, and TaskCollection. Will also rename component constructor arguments and _Collection properties on all objects.'),
'parser' => ['options' => compact('plugin', 'dryRun'), 'arguments' => compact('path')]
])
->addSubcommand('tests', [
'help' => __d('cake_console', 'Rename test case assertion methods.'),
'parser' => ['options' => compact('plugin', 'dryRun'), 'arguments' => compact('path')]
]);
}
Expand Down

0 comments on commit 24b8f35

Please sign in to comment.