More code standards formatting

This commit is contained in:
Kyle Robinson Young 2011-12-15 23:00:07 -08:00
parent 51f9837db4
commit d794084d38
12 changed files with 62 additions and 60 deletions

View file

@ -489,7 +489,7 @@ class DbAcl extends Object implements AclInterface {
return array(
'aro' => Set::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id'),
'aco' => Set::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id'),
'aco' => Set::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id'),
'link' => $this->Aro->Permission->find('all', array('conditions' => array(
$this->Aro->Permission->alias . '.aro_id' => Set::extract($obj, 'Aro.0.' . $this->Aro->alias . '.id'),
$this->Aro->Permission->alias . '.aco_id' => Set::extract($obj, 'Aco.0.' . $this->Aco->alias . '.id')

View file

@ -95,7 +95,7 @@ class AclNode extends AppModel {
$queryData['joins'][] = array(
'table' => $table,
'alias' => "{$type}{$i}",
'type' => 'LEFT',
'type' => 'LEFT',
'conditions' => array(
$db->name("{$type}{$i}.lft") . ' > ' . $db->name("{$type}{$j}.lft"),
$db->name("{$type}{$i}.rght") . ' < ' . $db->name("{$type}{$j}.rght"),

View file

@ -67,7 +67,7 @@ class Postgres extends DboSource {
*/
public $columns = array(
'primary_key' => array('name' => 'serial NOT NULL'),
'string' => array('name' => 'varchar', 'limit' => '255'),
'string' => array('name' => 'varchar', 'limit' => '255'),
'text' => array('name' => 'text'),
'integer' => array('name' => 'integer', 'formatter' => 'intval'),
'float' => array('name' => 'float', 'formatter' => 'floatval'),
@ -78,7 +78,7 @@ class Postgres extends DboSource {
'binary' => array('name' => 'bytea'),
'boolean' => array('name' => 'boolean'),
'number' => array('name' => 'numeric'),
'inet' => array('name' => 'inet')
'inet' => array('name' => 'inet')
);
/**
@ -218,14 +218,14 @@ class Postgres extends DboSource {
$length = null;
}
$fields[$c->name] = array(
'type' => $this->column($type),
'null' => ($c->null == 'NO' ? false : true),
'type' => $this->column($type),
'null' => ($c->null == 'NO' ? false : true),
'default' => preg_replace(
"/^'(.*)'$/",
"$1",
preg_replace('/::.*/', '', $c->default)
),
'length' => $length
'length' => $length
);
if ($model instanceof Model) {
if ($c->name == $model->primaryKey) {

View file

@ -255,7 +255,7 @@ class ModelIntegrationTest extends BaseModelTest {
array(
'table' => 'articles',
'alias' => 'Article',
'type' => 'LEFT',
'type' => 'LEFT',
'conditions' => array(
'User.id = Article.user_id',
),

View file

@ -3780,7 +3780,7 @@ class ModelWriteTest extends BaseModelTest {
),
array(
'body' => 3,
'published' => 'sd',
'published' => 'sd',
),
);
$Something->create();
@ -5320,7 +5320,7 @@ class ModelWriteTest extends BaseModelTest {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'product one',
'groupcode' => 120,
'group_id' => 1),
@ -5331,7 +5331,7 @@ class ModelWriteTest extends BaseModelTest {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'product two',
'groupcode' => 120,
'group_id' => 1),
@ -5384,7 +5384,7 @@ class ModelWriteTest extends BaseModelTest {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
@ -5395,7 +5395,7 @@ class ModelWriteTest extends BaseModelTest {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
@ -5437,7 +5437,7 @@ class ModelWriteTest extends BaseModelTest {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
@ -5448,7 +5448,7 @@ class ModelWriteTest extends BaseModelTest {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),

View file

@ -2504,7 +2504,7 @@ class UnconventionalTree extends NumberTree {
public $actsAs = array(
'Tree' => array(
'parent' => 'join',
'left' => 'left',
'left' => 'left',
'right' => 'right'
)
);

View file

@ -2909,7 +2909,7 @@ class SetTest extends CakeTestCase {
'item' => array(
'@attr' => '123',
'titles' => 'list',
'@' => 'textforitems'
'@' => 'textforitems'
)
)
);

View file

@ -34,24 +34,24 @@ class GroupUpdateAllFixture extends CakeTestFixture {
);
public $records = array(
array(
'id' => 1,
'name' => 'group one',
'code' => 120
'id' => 1,
'name' => 'group one',
'code' => 120
),
array(
'id' => 2,
'name' => 'group two',
'code' => 125
'id' => 2,
'name' => 'group two',
'code' => 125
),
array(
'id' => 3,
'name' => 'group three',
'code' => 130
'id' => 3,
'name' => 'group three',
'code' => 130
),
array(
'id' => 4,
'name' => 'group four',
'code' => 135
'id' => 4,
'name' => 'group four',
'code' => 135
),
);
}

View file

@ -276,12 +276,12 @@ class Debugger {
public static function trace($options = array()) {
$_this = Debugger::getInstance();
$defaults = array(
'depth' => 999,
'format' => $_this->_outputFormat,
'args' => false,
'start' => 0,
'scope' => null,
'exclude' => array('call_user_func_array', 'trigger_error')
'depth' => 999,
'format' => $_this->_outputFormat,
'args' => false,
'start' => 0,
'scope' => null,
'exclude' => array('call_user_func_array', 'trigger_error')
);
$options = Set::merge($defaults, $options);
@ -453,13 +453,13 @@ class Debugger {
return get_class($var) . "\n" . self::_object($var);
case 'array':
$var = array_merge($var, array_intersect_key(array(
'password' => '*****',
'login' => '*****',
'host' => '*****',
'database' => '*****',
'port' => '*****',
'prefix' => '*****',
'schema' => '*****'
'password' => '*****',
'login' => '*****',
'host' => '*****',
'database' => '*****',
'port' => '*****',
'prefix' => '*****',
'schema' => '*****'
), $var));
$out = "array(";

View file

@ -41,7 +41,7 @@ class Inflector {
'/(quiz)$/i' => '\1zes',
'/^(ox)$/i' => '\1\2en',
'/([m|l])ouse$/i' => '\1ice',
'/(matr|vert|ind)(ix|ex)$/i' => '\1ices',
'/(matr|vert|ind)(ix|ex)$/i' => '\1ices',
'/(x|ch|ss|sh)$/i' => '\1es',
'/([^aeiouy]|qu)y$/i' => '\1ies',
'/(hive)$/i' => '\1s',

View file

@ -154,20 +154,22 @@ class Validation {
}
$cards = array(
'all' => array(
'amex' => '/^3[4|7]\\d{13}$/',
'bankcard' => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
'diners' => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
'disc' => '/^(?:6011|650\\d)\\d{12}$/',
'electron' => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
'enroute' => '/^2(?:014|149)\\d{11}$/',
'jcb' => '/^(3\\d{4}|2100|1800)\\d{11}$/',
'maestro' => '/^(?:5020|6\\d{3})\\d{12}$/',
'mc' => '/^5[1-5]\\d{14}$/',
'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
'switch' => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
'visa' => '/^4\\d{12}(\\d{3})?$/',
'voyager' => '/^8699[0-9]{11}$/'),
'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/');
'amex' => '/^3[4|7]\\d{13}$/',
'bankcard' => '/^56(10\\d\\d|022[1-5])\\d{10}$/',
'diners' => '/^(?:3(0[0-5]|[68]\\d)\\d{11})|(?:5[1-5]\\d{14})$/',
'disc' => '/^(?:6011|650\\d)\\d{12}$/',
'electron' => '/^(?:417500|4917\\d{2}|4913\\d{2})\\d{10}$/',
'enroute' => '/^2(?:014|149)\\d{11}$/',
'jcb' => '/^(3\\d{4}|2100|1800)\\d{11}$/',
'maestro' => '/^(?:5020|6\\d{3})\\d{12}$/',
'mc' => '/^5[1-5]\\d{14}$/',
'solo' => '/^(6334[5-9][0-9]|6767[0-9]{2})\\d{10}(\\d{2,3})?$/',
'switch' => '/^(?:49(03(0[2-9]|3[5-9])|11(0[1-2]|7[4-9]|8[1-2])|36[0-9]{2})\\d{10}(\\d{2,3})?)|(?:564182\\d{10}(\\d{2,3})?)|(6(3(33[0-4][0-9])|759[0-9]{2})\\d{10}(\\d{2,3})?)$/',
'visa' => '/^4\\d{12}(\\d{3})?$/',
'voyager' => '/^8699[0-9]{11}$/'
),
'fast' => '/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})$/'
);
if (is_array($type)) {
foreach ($type as $value) {

View file

@ -144,9 +144,9 @@ class HtmlHelper extends AppHelper {
* @var array
*/
protected $_docTypes = array(
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'html4-strict' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
'html4-trans' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">',
'html4-frame' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">',
'html5' => '<!DOCTYPE html>',
'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
'xhtml-trans' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',