fix coding standards, remove break after return/continue

This commit is contained in:
Ceeram 2012-11-15 12:09:14 +01:00
parent e02eab05d5
commit 6d0e32e642
3 changed files with 0 additions and 25 deletions

View file

@ -146,7 +146,6 @@ class Permission extends AppModel {
return false; return false;
case 0: case 0:
continue; continue;
break;
case 1: case 1:
return true; return true;
} }

View file

@ -66,15 +66,12 @@ class TestBehavior extends ModelBehavior {
switch ($settings['beforeFind']) { switch ($settings['beforeFind']) {
case 'on': case 'on':
return false; return false;
break;
case 'test': case 'test':
return null; return null;
break;
case 'modify': case 'modify':
$query['fields'] = array($model->alias . '.id', $model->alias . '.name', $model->alias . '.mytime'); $query['fields'] = array($model->alias . '.id', $model->alias . '.name', $model->alias . '.mytime');
$query['recursive'] = -1; $query['recursive'] = -1;
return $query; return $query;
break;
} }
} }
@ -94,16 +91,12 @@ class TestBehavior extends ModelBehavior {
switch ($settings['afterFind']) { switch ($settings['afterFind']) {
case 'on': case 'on':
return array(); return array();
break;
case 'test': case 'test':
return true; return true;
break;
case 'test2': case 'test2':
return null; return null;
break;
case 'modify': case 'modify':
return Hash::extract($results, "{n}.{$model->alias}"); return Hash::extract($results, "{n}.{$model->alias}");
break;
} }
} }
@ -121,14 +114,11 @@ class TestBehavior extends ModelBehavior {
switch ($settings['beforeSave']) { switch ($settings['beforeSave']) {
case 'on': case 'on':
return false; return false;
break;
case 'test': case 'test':
return true; return true;
break;
case 'modify': case 'modify':
$model->data[$model->alias]['name'] .= ' modified before'; $model->data[$model->alias]['name'] .= ' modified before';
return true; return true;
break;
} }
} }
@ -157,7 +147,6 @@ class TestBehavior extends ModelBehavior {
break; break;
case 'test2': case 'test2':
return false; return false;
break;
case 'modify': case 'modify':
$model->data[$model->alias]['name'] .= ' ' . $string; $model->data[$model->alias]['name'] .= ' ' . $string;
break; break;
@ -179,18 +168,14 @@ class TestBehavior extends ModelBehavior {
case 'on': case 'on':
$model->invalidate('name'); $model->invalidate('name');
return true; return true;
break;
case 'test': case 'test':
return null; return null;
break;
case 'whitelist': case 'whitelist':
$this->_addToWhitelist($model, array('name')); $this->_addToWhitelist($model, array('name'));
return true; return true;
break;
case 'stop': case 'stop':
$model->invalidate('name'); $model->invalidate('name');
return false; return false;
break;
} }
} }
@ -209,11 +194,9 @@ class TestBehavior extends ModelBehavior {
switch ($settings['afterValidate']) { switch ($settings['afterValidate']) {
case 'on': case 'on':
return false; return false;
break;
case 'test': case 'test':
$model->data = array('foo'); $model->data = array('foo');
return true; return true;
break;
} }
} }
@ -232,17 +215,14 @@ class TestBehavior extends ModelBehavior {
switch ($settings['beforeDelete']) { switch ($settings['beforeDelete']) {
case 'on': case 'on':
return false; return false;
break;
case 'test': case 'test':
return null; return null;
break;
case 'test2': case 'test2':
echo 'beforeDelete success'; echo 'beforeDelete success';
if ($cascade) { if ($cascade) {
echo ' (cascading) '; echo ' (cascading) ';
} }
return true; return true;
break;
} }
} }

View file

@ -311,13 +311,10 @@ function env($key) {
$offset = 4; $offset = 4;
} }
return substr($filename, 0, -(strlen($name) + $offset)); return substr($filename, 0, -(strlen($name) + $offset));
break;
case 'PHP_SELF': case 'PHP_SELF':
return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME')); return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME'));
break;
case 'CGI_MODE': case 'CGI_MODE':
return (PHP_SAPI === 'cgi'); return (PHP_SAPI === 'cgi');
break;
case 'HTTP_BASE': case 'HTTP_BASE':
$host = env('HTTP_HOST'); $host = env('HTTP_HOST');
$parts = explode('.', $host); $parts = explode('.', $host);
@ -357,7 +354,6 @@ function env($key) {
} }
array_shift($parts); array_shift($parts);
return '.' . implode('.', $parts); return '.' . implode('.', $parts);
break;
} }
return null; return null;
} }