diff --git a/lib/Cake/Model/Permission.php b/lib/Cake/Model/Permission.php index b7c92d1a7..8d00f23ac 100644 --- a/lib/Cake/Model/Permission.php +++ b/lib/Cake/Model/Permission.php @@ -146,7 +146,6 @@ class Permission extends AppModel { return false; case 0: continue; - break; case 1: return true; } diff --git a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php index 21104eda5..d2df347aa 100644 --- a/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php +++ b/lib/Cake/Test/Case/Model/BehaviorCollectionTest.php @@ -66,15 +66,12 @@ class TestBehavior extends ModelBehavior { switch ($settings['beforeFind']) { case 'on': return false; - break; case 'test': return null; - break; case 'modify': $query['fields'] = array($model->alias . '.id', $model->alias . '.name', $model->alias . '.mytime'); $query['recursive'] = -1; return $query; - break; } } @@ -94,16 +91,12 @@ class TestBehavior extends ModelBehavior { switch ($settings['afterFind']) { case 'on': return array(); - break; case 'test': return true; - break; case 'test2': return null; - break; case 'modify': return Hash::extract($results, "{n}.{$model->alias}"); - break; } } @@ -121,14 +114,11 @@ class TestBehavior extends ModelBehavior { switch ($settings['beforeSave']) { case 'on': return false; - break; case 'test': return true; - break; case 'modify': $model->data[$model->alias]['name'] .= ' modified before'; return true; - break; } } @@ -157,7 +147,6 @@ class TestBehavior extends ModelBehavior { break; case 'test2': return false; - break; case 'modify': $model->data[$model->alias]['name'] .= ' ' . $string; break; @@ -179,18 +168,14 @@ class TestBehavior extends ModelBehavior { case 'on': $model->invalidate('name'); return true; - break; case 'test': return null; - break; case 'whitelist': $this->_addToWhitelist($model, array('name')); return true; - break; case 'stop': $model->invalidate('name'); return false; - break; } } @@ -209,11 +194,9 @@ class TestBehavior extends ModelBehavior { switch ($settings['afterValidate']) { case 'on': return false; - break; case 'test': $model->data = array('foo'); return true; - break; } } @@ -232,17 +215,14 @@ class TestBehavior extends ModelBehavior { switch ($settings['beforeDelete']) { case 'on': return false; - break; case 'test': return null; - break; case 'test2': echo 'beforeDelete success'; if ($cascade) { echo ' (cascading) '; } return true; - break; } } diff --git a/lib/Cake/basics.php b/lib/Cake/basics.php index 4f7c945f6..790852526 100644 --- a/lib/Cake/basics.php +++ b/lib/Cake/basics.php @@ -311,13 +311,10 @@ function env($key) { $offset = 4; } return substr($filename, 0, -(strlen($name) + $offset)); - break; case 'PHP_SELF': return str_replace(env('DOCUMENT_ROOT'), '', env('SCRIPT_FILENAME')); - break; case 'CGI_MODE': return (PHP_SAPI === 'cgi'); - break; case 'HTTP_BASE': $host = env('HTTP_HOST'); $parts = explode('.', $host); @@ -357,7 +354,6 @@ function env($key) { } array_shift($parts); return '.' . implode('.', $parts); - break; } return null; }