Skip to content

Commit

Permalink
Code standards fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Oct 29, 2012
1 parent 478461d commit f10c669
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
2 changes: 2 additions & 0 deletions lib/Cake/Console/Command/ServerShell.php
Expand Up @@ -24,10 +24,12 @@
* @package Cake.Console.Command
*/
class ServerShell extends AppShell {

/**
* Default ServerHost
*/
const DEFAULT_HOST = 'localhost';

/**
* Default ListenPort
*/
Expand Down
1 change: 0 additions & 1 deletion lib/Cake/Model/Permission.php
Expand Up @@ -146,7 +146,6 @@ public function check($aro, $aco, $action = "*") {
return false;
case 0:
continue;
break;
case 1:
return true;
}
Expand Down
20 changes: 0 additions & 20 deletions lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
Expand Up @@ -66,15 +66,12 @@ public function beforeFind(Model $model, $query) {
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;
}
}

Expand All @@ -94,16 +91,12 @@ public function afterFind(Model $model, $results, $primary) {
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;
}
}

Expand All @@ -121,14 +114,11 @@ public function beforeSave(Model $model) {
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;
}
}

Expand Down Expand Up @@ -157,7 +147,6 @@ public function afterSave(Model $model, $created) {
break;
case 'test2':
return false;
break;
case 'modify':
$model->data[$model->alias]['name'] .= ' ' . $string;
break;
Expand All @@ -179,18 +168,14 @@ public function beforeValidate(Model $model) {
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;
}
}

Expand All @@ -209,11 +194,9 @@ public function afterValidate(Model $model) {
switch ($settings['afterValidate']) {
case 'on':
return false;
break;
case 'test':
$model->data = array('foo');
return true;
break;
}
}

Expand All @@ -232,17 +215,14 @@ public function beforeDelete(Model $model, $cascade = true) {
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;
}
}

Expand Down

0 comments on commit f10c669

Please sign in to comment.