Skip to content

Commit

Permalink
More code standards formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Dec 16, 2011
1 parent 51f9837 commit d794084
Show file tree
Hide file tree
Showing 12 changed files with 62 additions and 60 deletions.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/AclComponent.php
Expand Up @@ -489,7 +489,7 @@ public function getAclLink($aro, $aco) {

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')
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Model/AclNode.php
Expand Up @@ -95,7 +95,7 @@ public function node($ref = null) {
$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"),
Expand Down
10 changes: 5 additions & 5 deletions lib/Cake/Model/Datasource/Database/Postgres.php
Expand Up @@ -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'),
Expand All @@ -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')
);

/**
Expand Down Expand Up @@ -218,14 +218,14 @@ public function describe($model) {
$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) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/ModelIntegrationTest.php
Expand Up @@ -255,7 +255,7 @@ function testFindWithJoinsOption() {
array(
'table' => 'articles',
'alias' => 'Article',
'type' => 'LEFT',
'type' => 'LEFT',
'conditions' => array(
'User.id = Article.user_id',
),
Expand Down
14 changes: 7 additions & 7 deletions lib/Cake/Test/Case/Model/ModelWriteTest.php
Expand Up @@ -3780,7 +3780,7 @@ public function testSaveAllValidateFirstAtomicFalse() {
),
array(
'body' => 3,
'published' => 'sd',
'published' => 'sd',
),
);
$Something->create();
Expand Down Expand Up @@ -5320,7 +5320,7 @@ public function testFindAllForeignKey() {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'product one',
'groupcode' => 120,
'group_id' => 1),
Expand All @@ -5331,7 +5331,7 @@ public function testFindAllForeignKey() {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'product two',
'groupcode' => 120,
'group_id' => 1),
Expand Down Expand Up @@ -5384,7 +5384,7 @@ public function testUpdateAllWithJoins() {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
Expand All @@ -5395,7 +5395,7 @@ public function testUpdateAllWithJoins() {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
Expand Down Expand Up @@ -5437,7 +5437,7 @@ public function testUpdateAllWithoutForeignKey() {
$expected = array(
'0' => array(
'ProductUpdateAll' => array(
'id' => 1,
'id' => 1,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
Expand All @@ -5448,7 +5448,7 @@ public function testUpdateAllWithoutForeignKey() {
),
'1' => array(
'ProductUpdateAll' => array(
'id' => 2,
'id' => 2,
'name' => 'new product',
'groupcode' => 120,
'group_id' => 1),
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Model/models.php
Expand Up @@ -2504,7 +2504,7 @@ class UnconventionalTree extends NumberTree {
public $actsAs = array(
'Tree' => array(
'parent' => 'join',
'left' => 'left',
'left' => 'left',
'right' => 'right'
)
);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Utility/SetTest.php
Expand Up @@ -2909,7 +2909,7 @@ public function testXmlSetReverse() {
'item' => array(
'@attr' => '123',
'titles' => 'list',
'@' => 'textforitems'
'@' => 'textforitems'
)
)
);
Expand Down
24 changes: 12 additions & 12 deletions lib/Cake/Test/Fixture/GroupUpdateAllFixture.php
Expand Up @@ -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
),
);
}
26 changes: 13 additions & 13 deletions lib/Cake/Utility/Debugger.php
Expand Up @@ -276,12 +276,12 @@ public static function showError($code, $description, $file = null, $line = null
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);

Expand Down Expand Up @@ -453,13 +453,13 @@ public static function exportVar($var, $recursion = 0) {
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(";
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Utility/Inflector.php
Expand Up @@ -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',
Expand Down
30 changes: 16 additions & 14 deletions lib/Cake/Utility/Validation.php
Expand Up @@ -154,20 +154,22 @@ public static function cc($check, $type = 'fast', $deep = false, $regex = null)
}
$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) {
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/View/Helper/HtmlHelper.php
Expand Up @@ -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">',
Expand Down

0 comments on commit d794084

Please sign in to comment.