coding standards and simplification of else cases as well as some minor fixes

This commit is contained in:
euromark 2013-07-03 00:52:48 +02:00
parent 58149f2315
commit 7cb19b97db
31 changed files with 142 additions and 169 deletions

View file

@ -123,8 +123,7 @@ class BakeShell extends AppShell {
$this->Test->execute();
break;
case 'Q':
exit(0);
break;
return $this->_stop();
default:
$this->out(__d('cake_console', 'You have made an invalid selection. Please choose a type of class to Bake by entering D, M, V, F, T, or C.'));
}

View file

@ -172,7 +172,7 @@ class ConsoleShell extends AppShell {
switch ($command) {
case 'help':
$this->help();
break;
break;
case 'quit':
case 'exit':
return true;
@ -182,7 +182,7 @@ class ConsoleShell extends AppShell {
foreach ($this->models as $model) {
$this->out(" - {$model}");
}
break;
break;
case preg_match("/^(\w+) bind (\w+) (\w+)/", $command, $tmp):
foreach ($tmp as $data) {
$data = strip_tags($data);
@ -200,7 +200,7 @@ class ConsoleShell extends AppShell {
} else {
$this->out(__d('cake_console', "Please verify you are using valid models and association types"));
}
break;
break;
case preg_match("/^(\w+) unbind (\w+) (\w+)/", $command, $tmp):
foreach ($tmp as $data) {
$data = strip_tags($data);
@ -228,7 +228,7 @@ class ConsoleShell extends AppShell {
} else {
$this->out(__d('cake_console', "Please verify you are using valid models, valid current association, and valid association types"));
}
break;
break;
case (strpos($command, "->find") > 0):
// Remove any bad info
$command = strip_tags($command);
@ -285,7 +285,7 @@ class ConsoleShell extends AppShell {
$this->out(__d('cake_console', "%s is not a valid model", $modelToCheck));
}
break;
break;
case (strpos($command, '->save') > 0):
// Validate the model we're trying to save here
$command = strip_tags($command);
@ -302,7 +302,7 @@ class ConsoleShell extends AppShell {
//@codingStandardsIgnoreEnd
$this->out(__d('cake_console', 'Saved record for %s', $modelToSave));
}
break;
break;
case preg_match("/^(\w+) columns/", $command, $tmp):
$modelToCheck = strip_tags(str_replace($this->badCommandChars, "", $tmp[1]));
@ -321,31 +321,30 @@ class ConsoleShell extends AppShell {
} else {
$this->out(__d('cake_console', "Please verify that you selected a valid model"));
}
break;
break;
case preg_match("/^routes\s+reload/i", $command, $tmp):
if (!$this->_loadRoutes()) {
$this->err(__d('cake_console', "There was an error loading the routes config. Please check that the file exists and is free of parse errors."));
break;
}
$this->out(__d('cake_console', "Routes configuration reloaded, %d routes connected", count(Router::$routes)));
break;
break;
case preg_match("/^routes\s+show/i", $command, $tmp):
$this->out(print_r(Hash::combine(Router::$routes, '{n}.template', '{n}.defaults'), true));
break;
break;
case (preg_match("/^route\s+(\(.*\))$/i", $command, $tmp) == true):
//@codingStandardsIgnoreStart
if ($url = eval('return array' . $tmp[1] . ';')) {
//@codingStandardsIgnoreEnd
$this->out(Router::url($url));
}
break;
break;
case preg_match("/^route\s+(.*)/i", $command, $tmp):
$this->out(var_export(Router::parse($tmp[1]), true));
break;
break;
default:
$this->out(__d('cake_console', "Invalid command"));
$this->out();
break;
}
$command = '';
}

View file

@ -76,16 +76,15 @@ class I18nShell extends AppShell {
switch ($choice) {
case 'e':
$this->Extract->execute();
break;
break;
case 'i':
$this->initdb();
break;
break;
case 'h':
$this->out($this->OptionParser->help());
break;
break;
case 'q':
exit(0);
break;
return $this->_stop();
default:
$this->out(__d('cake_console', 'You have made an invalid selection. Please choose a command to execute by entering E, I, H, or Q.'));
}

View file

@ -107,11 +107,10 @@ class SchemaShell extends AppShell {
if ($File->exists()) {
$this->out($File->read());
return $this->_stop();
} else {
$file = $this->Schema->path . DS . $this->params['file'];
$this->err(__d('cake_console', 'Schema file (%s) could not be found.', $file));
return $this->_stop();
}
$file = $this->Schema->path . DS . $this->params['file'];
$this->err(__d('cake_console', 'Schema file (%s) could not be found.', $file));
return $this->_stop();
}
/**
@ -185,10 +184,9 @@ class SchemaShell extends AppShell {
if ($this->Schema->write($content)) {
$this->out(__d('cake_console', 'Schema file: %s generated', $content['file']));
return $this->_stop();
} else {
$this->err(__d('cake_console', 'Schema file: %s generated'));
return $this->_stop();
}
$this->err(__d('cake_console', 'Schema file: %s generated'));
return $this->_stop();
}
/**

View file

@ -304,7 +304,7 @@ class FixtureTask extends BakeTask {
case 'integer':
case 'float':
$insert = $i + 1;
break;
break;
case 'string':
case 'binary':
$isPrimaryUuid = (
@ -319,22 +319,22 @@ class FixtureTask extends BakeTask {
$insert = substr($insert, 0, (int)$fieldInfo['length'] - 2);
}
}
break;
break;
case 'timestamp':
$insert = time();
break;
break;
case 'datetime':
$insert = date('Y-m-d H:i:s');
break;
break;
case 'date':
$insert = date('Y-m-d');
break;
break;
case 'time':
$insert = date('H:i:s');
break;
break;
case 'boolean':
$insert = 1;
break;
break;
case 'text':
$insert = "Lorem ipsum dolor sit amet, aliquet feugiat.";
$insert .= " Convallis morbi fringilla gravida,";
@ -343,7 +343,7 @@ class FixtureTask extends BakeTask {
$insert .= " vestibulum massa neque ut et, id hendrerit sit,";
$insert .= " feugiat in taciti enim proin nibh, tempor dignissim, rhoncus";
$insert .= " duis vestibulum nunc mattis convallis.";
break;
break;
}
$record[$field] = $insert;
}

View file

@ -65,9 +65,8 @@ class PluginTask extends AppShell {
$this->out(__d('cake_console', 'Plugin: %s already exists, no action taken', $plugin));
$this->out(__d('cake_console', 'Path: %s', $pluginPath));
return false;
} else {
$this->_interactive($plugin);
}
$this->_interactive($plugin);
} else {
return $this->_interactive();
}

View file

@ -368,12 +368,9 @@ class ProjectTask extends AppShell {
if ($File->write($result)) {
Configure::write('Routing.prefixes', array($name));
return true;
} else {
return false;
}
} else {
return false;
}
return false;
}
/**

View file

@ -250,9 +250,8 @@ class Scaffold {
$success
);
return $this->_sendMessage($message);
} else {
return $this->controller->afterScaffoldSaveError($action);
}
return $this->controller->afterScaffoldSaveError($action);
} else {
if ($this->_validSession) {
$this->controller->Session->setFlash(__d('cake', 'Please correct errors below.'));
@ -309,14 +308,13 @@ class Scaffold {
if ($this->ScaffoldModel->delete()) {
$message = __d('cake', 'The %1$s with id: %2$s has been deleted.', Inflector::humanize($this->modelClass), $id);
return $this->_sendMessage($message);
} else {
$message = __d('cake',
'There was an error deleting the %1$s with id: %2$s',
Inflector::humanize($this->modelClass),
$id
);
return $this->_sendMessage($message);
}
$message = __d('cake',
'There was an error deleting the %1$s with id: %2$s',
Inflector::humanize($this->modelClass),
$id
);
return $this->_sendMessage($message);
} elseif ($this->controller->scaffoldError('delete') === false) {
return $this->_scaffoldError();
}
@ -388,21 +386,21 @@ class Scaffold {
case 'index':
case 'list':
$this->_scaffoldIndex($request);
break;
break;
case 'view':
$this->_scaffoldView($request);
break;
break;
case 'add':
case 'create':
$this->_scaffoldSave($request, 'add');
break;
break;
case 'edit':
case 'update':
$this->_scaffoldSave($request, 'edit');
break;
break;
case 'delete':
$this->_scaffoldDelete($request);
break;
break;
}
} else {
throw new MissingActionException(array(

View file

@ -198,14 +198,13 @@ class ErrorHandler {
'path' => Debugger::trimPath($file)
);
return Debugger::getInstance()->outputError($data);
} else {
$message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
if (!empty($errorConfig['trace'])) {
$trace = Debugger::trace(array('start' => 1, 'format' => 'log'));
$message .= "\nTrace:\n" . $trace . "\n";
}
return CakeLog::write($log, $message);
}
$message = $error . ' (' . $code . '): ' . $description . ' in [' . $file . ', line ' . $line . ']';
if (!empty($errorConfig['trace'])) {
$trace = Debugger::trace(array('start' => 1, 'format' => 'log'));
$message .= "\nTrace:\n" . $trace . "\n";
}
return CakeLog::write($log, $message);
}
/**
@ -254,28 +253,28 @@ class ErrorHandler {
case E_USER_ERROR:
$error = 'Fatal Error';
$log = LOG_ERR;
break;
break;
case E_WARNING:
case E_USER_WARNING:
case E_COMPILE_WARNING:
case E_RECOVERABLE_ERROR:
$error = 'Warning';
$log = LOG_WARNING;
break;
break;
case E_NOTICE:
case E_USER_NOTICE:
$error = 'Notice';
$log = LOG_NOTICE;
break;
break;
case E_STRICT:
$error = 'Strict';
$log = LOG_NOTICE;
break;
break;
case E_DEPRECATED:
case E_USER_DEPRECATED:
$error = 'Deprecated';
$log = LOG_NOTICE;
break;
break;
}
return array($error, $log);
}

View file

@ -762,17 +762,16 @@ class TreeBehavior extends ModelBehavior {
array($Model->escapeField() => $id)
);
return $Model->delete($id);
} else {
$edge = $this->_getMax($Model, $scope, $right, $recursive);
if ($node[$right] == $edge) {
$edge = $edge - 2;
}
$Model->id = $id;
return $Model->save(
array($left => $edge + 1, $right => $edge + 2, $parent => null),
array('callbacks' => false, 'validate' => false)
);
}
$edge = $this->_getMax($Model, $scope, $right, $recursive);
if ($node[$right] == $edge) {
$edge = $edge - 2;
}
$Model->id = $id;
return $Model->save(
array($left => $edge + 1, $right => $edge + 2, $parent => null),
array('callbacks' => false, 'validate' => false)
);
}
/**

View file

@ -357,7 +357,7 @@ class DataSource extends Object {
}
}
$type = $model->getColumnType($model->primaryKey);
break;
break;
case '{$__cakeForeignKey__$}':
foreach ($model->associations() as $name) {
foreach ($model->$name as $assocName => $assoc) {
@ -389,7 +389,7 @@ class DataSource extends Object {
}
}
}
break;
break;
}
if (empty($val) && $val !== '0') {
return false;

View file

@ -516,13 +516,13 @@ class Mysql extends DboSource {
}
$colList[] = $alter;
}
break;
break;
case 'drop':
foreach ($column as $field => $col) {
$col['name'] = $field;
$colList[] = 'DROP ' . $this->name($field);
}
break;
break;
case 'change':
foreach ($column as $field => $col) {
if (!isset($col['name'])) {
@ -530,7 +530,7 @@ class Mysql extends DboSource {
}
$colList[] = 'CHANGE ' . $this->name($field) . ' ' . $this->buildColumn($col);
}
break;
break;
}
}
$colList = array_merge($colList, $this->_alterIndexes($curTable, $indexes));

View file

@ -516,13 +516,13 @@ class Postgres extends DboSource {
$col['name'] = $field;
$colList[] = 'ADD COLUMN ' . $this->buildColumn($col);
}
break;
break;
case 'drop':
foreach ($column as $field => $col) {
$col['name'] = $field;
$colList[] = 'DROP COLUMN ' . $this->name($field);
}
break;
break;
case 'change':
foreach ($column as $field => $col) {
if (!isset($col['name'])) {
@ -552,7 +552,7 @@ class Postgres extends DboSource {
}
}
break;
break;
}
}
if (isset($indexes['drop']['PRIMARY'])) {
@ -748,21 +748,19 @@ class Postgres extends DboSource {
switch ($type) {
case 'bool':
$resultRow[$table][$column] = is_null($row[$index]) ? null : $this->boolean($row[$index]);
break;
break;
case 'binary':
case 'bytea':
$resultRow[$table][$column] = is_null($row[$index]) ? null : stream_get_contents($row[$index]);
break;
break;
default:
$resultRow[$table][$column] = $row[$index];
break;
}
}
return $resultRow;
} else {
$this->_result->closeCursor();
return false;
}
$this->_result->closeCursor();
return false;
}
/**
@ -788,7 +786,6 @@ class Postgres extends DboSource {
break;
default:
$result = (bool)$data;
break;
}
if ($quote) {

View file

@ -1569,7 +1569,7 @@ class DboSource extends DataSource {
}
return true;
}
break;
break;
case 'hasMany':
$assocData['fields'] = $this->fields($linkModel, $association, $assocData['fields']);
if (!empty($assocData['foreignKey'])) {
@ -1585,7 +1585,7 @@ class DboSource extends DataSource {
'offset' => $assocData['offset'],
'group' => null
);
break;
break;
case 'hasAndBelongsToMany':
$joinFields = array();
$joinAssoc = null;
@ -1622,7 +1622,7 @@ class DboSource extends DataSource {
'conditions' => $this->getConstraint('hasAndBelongsToMany', $model, $linkModel, $joinAlias, $assocData, $association)
))
);
break;
break;
}
if (isset($query)) {
return $this->buildStatement($query, $model);
@ -2596,22 +2596,22 @@ class DboSource extends DataSource {
switch ($operator) {
case '=':
$operator = 'IN';
break;
break;
case '!=':
case '<>':
$operator = 'NOT IN';
break;
break;
}
$value = "({$value})";
} elseif ($null || $value === 'NULL') {
switch ($operator) {
case '=':
$operator = 'IS';
break;
break;
case '!=':
case '<>':
$operator = 'IS NOT';
break;
break;
}
}
if ($virtual) {

View file

@ -1058,34 +1058,34 @@ class Model extends Object implements CakeEventListener {
switch ($key) {
case 'fields':
$data = '';
break;
break;
case 'foreignKey':
$data = (($type === 'belongsTo') ? Inflector::underscore($assocKey) : Inflector::singularize($this->table)) . '_id';
break;
break;
case 'associationForeignKey':
$data = Inflector::singularize($this->{$class}->table) . '_id';
break;
break;
case 'with':
$data = Inflector::camelize(Inflector::singularize($this->{$type}[$assocKey]['joinTable']));
$dynamicWith = true;
break;
break;
case 'joinTable':
$tables = array($this->table, $this->{$class}->table);
sort($tables);
$data = $tables[0] . '_' . $tables[1];
break;
break;
case 'className':
$data = $class;
break;
break;
case 'unique':
$data = true;
break;
break;
}
$this->{$type}[$assocKey][$key] = $data;
}
@ -2281,7 +2281,7 @@ class Model extends Object implements CakeEventListener {
$validationErrors[$association] = $this->{$association}->validationErrors;
}
$return[$association] = $validates;
break;
break;
case 'hasMany':
foreach ($values as $i => $value) {
if (isset($values[$i][$association])) {
@ -2297,7 +2297,7 @@ class Model extends Object implements CakeEventListener {
$validates = false;
}
$return[$association] = $_return;
break;
break;
}
}
}

View file

@ -142,15 +142,15 @@ class TestBehavior extends ModelBehavior {
switch ($settings['afterSave']) {
case 'on':
$model->data[$model->alias]['aftersave'] = $string;
break;
break;
case 'test':
unset($model->data[$model->alias]['name']);
break;
break;
case 'test2':
return false;
case 'modify':
$model->data[$model->alias]['name'] .= ' ' . $string;
break;
break;
}
}
@ -241,7 +241,7 @@ class TestBehavior extends ModelBehavior {
switch ($settings['afterDelete']) {
case 'on':
echo 'afterDelete success';
break;
break;
}
}

View file

@ -47,10 +47,9 @@ class CakeTestModel extends Model {
case
(is_string($queryData['fields']) && !($queryData['fields'] == $pk || $queryData['fields'] == $aliasedPk)) ||
(is_array($queryData['fields']) && !(array_key_exists($pk, $queryData['fields']) || array_key_exists($aliasedPk, $queryData['fields']))):
break;
break;
default:
$queryData['order'] = array($this->alias . '.' . $this->primaryKey => 'ASC');
break;
}
return $queryData;
}

View file

@ -97,14 +97,13 @@ class CakeTime {
*
* @param string $name Variable name
* @param mixes $value Variable value
* @return void
*/
public function __set($name, $value) {
switch ($name) {
case 'niceFormat':
self::${$name} = $value;
break;
default:
break;
}
}

View file

@ -230,24 +230,24 @@ class Debugger {
case E_USER_ERROR:
$error = 'Fatal Error';
$level = LOG_ERR;
break;
break;
case E_WARNING:
case E_USER_WARNING:
case E_COMPILE_WARNING:
case E_RECOVERABLE_ERROR:
$error = 'Warning';
$level = LOG_WARNING;
break;
break;
case E_NOTICE:
case E_USER_NOTICE:
$error = 'Notice';
$level = LOG_NOTICE;
break;
break;
case E_DEPRECATED:
case E_USER_DEPRECATED:
$error = 'Deprecated';
$level = LOG_NOTICE;
break;
break;
default:
return;
}

View file

@ -308,7 +308,7 @@ class Inflector {
} else {
self::$_transliteration = $rules + self::$_transliteration;
}
break;
break;
default:
foreach ($rules as $rule => $pattern) {
@ -334,7 +334,6 @@ class Inflector {
}
}
self::${$var}['rules'] = $rules + self::${$var}['rules'];
break;
}
}

View file

@ -255,7 +255,6 @@ class Validation {
break;
default:
self::$errors[] = __d('cake_dev', 'You must define the $operator parameter for Validation::comparison()');
break;
}
return false;
}

View file

@ -662,18 +662,16 @@ class Helper extends Object {
switch ($field) {
case '_method':
$name = $field;
break;
break;
default:
$name = 'data[' . implode('][', $this->entity()) . ']';
break;
}
if (is_array($options)) {
$options[$key] = $name;
return $options;
} else {
return $name;
}
return $name;
}
/**
@ -729,9 +727,8 @@ class Helper extends Object {
if (is_array($options)) {
$options[$key] = $result;
return $options;
} else {
return $result;
}
return $result;
}
/**
@ -920,7 +917,7 @@ class Helper extends Object {
do {
$oldstring = $this->_cleaned;
$this->_cleaned = preg_replace('#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $this->_cleaned);
} while ($oldstring != $this->_cleaned);
} while ($oldstring !== $this->_cleaned);
$this->_cleaned = str_replace(array("&amp;", "&lt;", "&gt;"), array("&amp;amp;", "&amp;lt;", "&amp;gt;"), $this->_cleaned);
}

View file

@ -407,7 +407,7 @@ class FormHelper extends AppHelper {
switch (strtolower($options['type'])) {
case 'get':
$htmlAttributes['method'] = 'get';
break;
break;
case 'file':
$htmlAttributes['enctype'] = 'multipart/form-data';
$options['type'] = ($created) ? 'put' : 'post';
@ -420,7 +420,6 @@ class FormHelper extends AppHelper {
));
default:
$htmlAttributes['method'] = 'post';
break;
}
$this->requestType = strtolower($options['type']);
@ -2456,16 +2455,16 @@ class FormHelper extends AppHelper {
$selects[] = $this->year(
$fieldName, $minYear, $maxYear, $attrs['Year']
);
break;
break;
case 'M':
$attrs['Month']['value'] = $month;
$attrs['Month']['monthNames'] = $monthNames;
$selects[] = $this->month($fieldName, $attrs['Month']);
break;
break;
case 'D':
$attrs['Day']['value'] = $day;
$selects[] = $this->day($fieldName, $attrs['Day']);
break;
break;
}
}
$opt = implode($separator, $selects);
@ -2477,7 +2476,7 @@ class FormHelper extends AppHelper {
$attrs['Minute']['value'] = $min;
$opt .= $this->hour($fieldName, true, $attrs['Hour']) . ':' .
$this->minute($fieldName, $attrs['Minute']);
break;
break;
case '12':
$attrs['Hour']['value'] = $hour;
$attrs['Minute']['value'] = $min;
@ -2485,7 +2484,7 @@ class FormHelper extends AppHelper {
$opt .= $this->hour($fieldName, false, $attrs['Hour']) . ':' .
$this->minute($fieldName, $attrs['Minute']) . ' ' .
$this->meridian($fieldName, $attrs['Meridian']);
break;
break;
}
return $opt;
}
@ -2719,20 +2718,20 @@ class FormHelper extends AppHelper {
$data[sprintf('%02d', $i)] = sprintf('%02d', $i);
$i += $interval;
}
break;
break;
case 'hour':
for ($i = 1; $i <= 12; $i++) {
$data[sprintf('%02d', $i)] = $i;
}
break;
break;
case 'hour24':
for ($i = 0; $i <= 23; $i++) {
$data[sprintf('%02d', $i)] = $i;
}
break;
break;
case 'meridian':
$data = array('am' => 'am', 'pm' => 'pm');
break;
break;
case 'day':
$min = 1;
$max = 31;
@ -2747,7 +2746,7 @@ class FormHelper extends AppHelper {
for ($i = $min; $i <= $max; $i++) {
$data[sprintf('%02d', $i)] = $i;
}
break;
break;
case 'month':
if ($options['monthNames'] === true) {
$data['01'] = __d('cake', 'January');
@ -2769,7 +2768,7 @@ class FormHelper extends AppHelper {
$data[sprintf("%02s", $m)] = strftime("%m", mktime(1, 1, 1, $m, 1, 1999));
}
}
break;
break;
case 'year':
$current = intval(date('Y'));
@ -2791,7 +2790,7 @@ class FormHelper extends AppHelper {
if ($options['order'] !== 'asc') {
$data = array_reverse($data, true);
}
break;
break;
}
$this->_options[$name] = $data;
return $this->_options[$name];

View file

@ -235,7 +235,7 @@ class JqueryEngineHelper extends JsBaseEngineHelper {
case 'slideDown':
case 'slideUp':
$effect = ".$name($speed);";
break;
break;
}
return $this->selection . $effect;
}

View file

@ -147,25 +147,24 @@ abstract class JsBaseEngineHelper extends AppHelper {
switch (true) {
case (is_array($val) || is_object($val)):
$val = $this->object($val);
break;
break;
case ($val === null):
$val = 'null';
break;
break;
case (is_bool($val)):
$val = ($val === true) ? 'true' : 'false';
break;
break;
case (is_int($val)):
$val = $val;
break;
break;
case (is_float($val)):
$val = sprintf("%.11f", $val);
break;
break;
default:
$val = $this->escape($val);
if ($quoteString) {
$val = '"' . $val . '"';
}
break;
}
return $val;
}

View file

@ -205,10 +205,10 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
switch ($name) {
case 'hide':
$effect = 'setStyle("display", "none")';
break;
break;
case 'show':
$effect = 'setStyle("display", "")';
break;
break;
case 'fadeIn':
case 'fadeOut':
case 'slideIn':
@ -219,7 +219,7 @@ class MootoolsEngineHelper extends JsBaseEngineHelper {
$effect .= "set(\"$effectName\", {duration:$speed}).";
}
$effect .= "$effectName(\"$direction\")";
break;
break;
}
return $this->selection . '.' . $effect . ';';
}

View file

@ -628,10 +628,10 @@ class PaginatorHelper extends AppHelper {
}
$out = $start . $options['separator'][0] . $end . $options['separator'][1];
$out .= $paging['count'];
break;
break;
case 'pages':
$out = $paging['page'] . $options['separator'] . $paging['pageCount'];
break;
break;
default:
$map = array(
'%page%' => $paging['page'],
@ -648,7 +648,6 @@ class PaginatorHelper extends AppHelper {
'{:page}', '{:pages}', '{:current}', '{:count}', '{:start}', '{:end}', '{:model}'
);
$out = str_replace($newKeys, array_values($map), $out);
break;
}
return $out;
}

View file

@ -212,17 +212,17 @@ class PrototypeEngineHelper extends JsBaseEngineHelper {
case 'hide':
case 'show':
$effect = $this->selection . '.' . $name . '();';
break;
break;
case 'slideIn':
case 'slideOut':
$name = ($name === 'slideIn') ? 'slideDown' : 'slideUp';
$effect = 'Effect.' . $name . '(' . $this->selection . $optionString . ');';
break;
break;
case 'fadeIn':
case 'fadeOut':
$name = ($name === 'fadeIn') ? 'appear' : 'fade';
$effect = $this->selection . '.' . $name . '(' . substr($optionString, 2) . ');';
break;
break;
}
return $effect;
}

View file

@ -208,7 +208,7 @@ class RssHelper extends AppHelper {
switch ($key) {
case 'pubDate' :
$val = $this->time($val);
break;
break;
case 'category' :
if (is_array($val) && !empty($val[0])) {
foreach ($val as $category) {
@ -224,7 +224,7 @@ class RssHelper extends AppHelper {
} elseif (is_array($val) && isset($val['domain'])) {
$attrib['domain'] = $val['domain'];
}
break;
break;
case 'link':
case 'guid':
case 'comments':
@ -234,7 +234,7 @@ class RssHelper extends AppHelper {
$val = $val['url'];
}
$val = $this->url($val, true);
break;
break;
case 'source':
if (is_array($val) && isset($val['url'])) {
$attrib['url'] = $this->url($val['url'], true);
@ -243,7 +243,7 @@ class RssHelper extends AppHelper {
$attrib['url'] = $this->url($val[0], true);
$val = $val[1];
}
break;
break;
case 'enclosure':
if (is_string($val['url']) && is_file(WWW_ROOT . $val['url']) && file_exists(WWW_ROOT . $val['url'])) {
if (!isset($val['length']) && strpos($val['url'], '://') === false) {
@ -256,7 +256,7 @@ class RssHelper extends AppHelper {
$val['url'] = $this->url($val['url'], true);
$attrib = $val;
$val = null;
break;
break;
default:
$attrib = $att;
}

View file

@ -75,10 +75,9 @@ class TimeHelper extends AppHelper {
switch ($name) {
case 'niceFormat':
$this->_engine->{$name} = $value;
break;
break;
default:
$this->{$name} = $value;
break;
}
}

View file

@ -402,13 +402,13 @@ if (!function_exists('cache')) {
switch (strtolower($target)) {
case 'cache':
$filename = CACHE . $path;
break;
break;
case 'public':
$filename = WWW_ROOT . $path;
break;
break;
case 'tmp':
$filename = TMP . $path;
break;
break;
}
$timediff = $expires - $now;
$filetime = false;