correcting coding-standards

This commit is contained in:
euromark 2012-09-28 13:49:51 +02:00
parent 76d21c6d56
commit b7f1740d2b
7 changed files with 70 additions and 70 deletions

View file

@ -688,7 +688,7 @@ class ModelTask extends BakeTask {
$prompt = __d('cake_console', 'Would you like to define some additional model associations?'); $prompt = __d('cake_console', 'Would you like to define some additional model associations?');
$wannaDoMoreAssoc = $this->in($prompt, array('y', 'n'), 'n'); $wannaDoMoreAssoc = $this->in($prompt, array('y', 'n'), 'n');
$possibleKeys = $this->_generatePossibleKeys(); $possibleKeys = $this->_generatePossibleKeys();
while (strtolower($wannaDoMoreAssoc) == 'y') { while (strtolower($wannaDoMoreAssoc) === 'y') {
$assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany'); $assocs = array('belongsTo', 'hasOne', 'hasMany', 'hasAndBelongsToMany');
$this->out(__d('cake_console', 'What is the association type?')); $this->out(__d('cake_console', 'What is the association type?'));
$assocType = intval($this->inOptions($assocs, __d('cake_console', 'Enter a number'))); $assocType = intval($this->inOptions($assocs, __d('cake_console', 'Enter a number')));
@ -700,7 +700,7 @@ class ModelTask extends BakeTask {
$alias = $this->in(__d('cake_console', 'What is the alias for this association?')); $alias = $this->in(__d('cake_console', 'What is the alias for this association?'));
$className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias); $className = $this->in(__d('cake_console', 'What className will %s use?', $alias), null, $alias);
if ($assocType == 0) { if ($assocType === 0) {
if (!empty($possibleKeys[$model->table])) { if (!empty($possibleKeys[$model->table])) {
$showKeys = $possibleKeys[$model->table]; $showKeys = $possibleKeys[$model->table];
} else { } else {
@ -733,7 +733,7 @@ class ModelTask extends BakeTask {
if (!isset($foreignKey)) { if (!isset($foreignKey)) {
$foreignKey = $this->in(__d('cake_console', 'What is the foreignKey? Specify your own.'), null, $suggestedForeignKey); $foreignKey = $this->in(__d('cake_console', 'What is the foreignKey? Specify your own.'), null, $suggestedForeignKey);
} }
if ($assocType == 3) { if ($assocType === 3) {
$associationForeignKey = $this->in(__d('cake_console', 'What is the associationForeignKey?'), null, $this->_modelKey($model->name)); $associationForeignKey = $this->in(__d('cake_console', 'What is the associationForeignKey?'), null, $this->_modelKey($model->name));
$joinTable = $this->in(__d('cake_console', 'What is the joinTable?')); $joinTable = $this->in(__d('cake_console', 'What is the joinTable?'));
} }
@ -743,7 +743,7 @@ class ModelTask extends BakeTask {
$associations[$assocs[$assocType]][$i]['alias'] = $alias; $associations[$assocs[$assocType]][$i]['alias'] = $alias;
$associations[$assocs[$assocType]][$i]['className'] = $className; $associations[$assocs[$assocType]][$i]['className'] = $className;
$associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey; $associations[$assocs[$assocType]][$i]['foreignKey'] = $foreignKey;
if ($assocType == 3) { if ($assocType === 3) {
$associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey; $associations[$assocs[$assocType]][$i]['associationForeignKey'] = $associationForeignKey;
$associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable; $associations[$assocs[$assocType]][$i]['joinTable'] = $joinTable;
} }

View file

@ -118,7 +118,7 @@ class PhpAclTest extends CakeTestCase {
$this->Acl->Aro->addAlias(array('Role/25' => 'Role/IT')); $this->Acl->Aro->addAlias(array('Role/25' => 'Role/IT'));
$this->Acl->allow('Role/IT', '/rules/debugging/*'); $this->Acl->allow('Role/IT', '/rules/debugging/*');
$this->assertEquals(array(array('Role/IT', )), $this->Acl->Aro->roles($user)); $this->assertEquals(array(array('Role/IT')), $this->Acl->Aro->roles($user));
$this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload')); $this->assertTrue($this->Acl->check($user, '/rules/debugging/stats/pageload'));
$this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries')); $this->assertTrue($this->Acl->check($user, '/rules/debugging/sql/queries'));
// Role/default is allowed users dashboard, but not Role/IT // Role/default is allowed users dashboard, but not Role/IT

View file

@ -636,8 +636,8 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$parent = $this->Tree->findByName('1. Root', array('id')); $parent = $this->Tree->findByName('1. Root', array('id'));
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array(array($modelClass => array('name' => '1.2', )), $expected = array(array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.1', ))); array($modelClass => array('name' => '1.1')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -658,8 +658,8 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$parent = $this->Tree->findByName('1. Root', array('id')); $parent = $this->Tree->findByName('1. Root', array('id'));
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array(array($modelClass => array('name' => '1.1', )), $expected = array(array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', ))); array($modelClass => array('name' => '1.2')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -680,16 +680,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array( $expected = array(
array($modelClass => array('name' => '1.1', )), array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', )), array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.5', )), array($modelClass => array('name' => '1.5')),
array($modelClass => array('name' => '1.3', )), array($modelClass => array('name' => '1.3')),
array($modelClass => array('name' => '1.4', )), array($modelClass => array('name' => '1.4')),
array($modelClass => array('name' => '1.6', )), array($modelClass => array('name' => '1.6')),
array($modelClass => array('name' => '1.7', )), array($modelClass => array('name' => '1.7')),
array($modelClass => array('name' => '1.8', )), array($modelClass => array('name' => '1.8')),
array($modelClass => array('name' => '1.9', )), array($modelClass => array('name' => '1.9')),
array($modelClass => array('name' => '1.10', ))); array($modelClass => array('name' => '1.10')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -710,16 +710,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array( $expected = array(
array($modelClass => array('name' => '1.5', )), array($modelClass => array('name' => '1.5')),
array($modelClass => array('name' => '1.1', )), array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', )), array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.3', )), array($modelClass => array('name' => '1.3')),
array($modelClass => array('name' => '1.4', )), array($modelClass => array('name' => '1.4')),
array($modelClass => array('name' => '1.6', )), array($modelClass => array('name' => '1.6')),
array($modelClass => array('name' => '1.7', )), array($modelClass => array('name' => '1.7')),
array($modelClass => array('name' => '1.8', )), array($modelClass => array('name' => '1.8')),
array($modelClass => array('name' => '1.9', )), array($modelClass => array('name' => '1.9')),
array($modelClass => array('name' => '1.10', ))); array($modelClass => array('name' => '1.10')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -739,8 +739,8 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$parent = $this->Tree->findByName('1. Root', array('id')); $parent = $this->Tree->findByName('1. Root', array('id'));
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array(array($modelClass => array('name' => '1.2', )), $expected = array(array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.1', ))); array($modelClass => array('name' => '1.1')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -760,8 +760,8 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$parent = $this->Tree->findByName('1. Root', array('id')); $parent = $this->Tree->findByName('1. Root', array('id'));
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array(array($modelClass => array('name' => '1.1', )), $expected = array(array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', ))); array($modelClass => array('name' => '1.2')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -782,16 +782,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array( $expected = array(
array($modelClass => array('name' => '1.1', )), array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', )), array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.3', )), array($modelClass => array('name' => '1.3')),
array($modelClass => array('name' => '1.4', )), array($modelClass => array('name' => '1.4')),
array($modelClass => array('name' => '1.6', )), array($modelClass => array('name' => '1.6')),
array($modelClass => array('name' => '1.7', )), array($modelClass => array('name' => '1.7')),
array($modelClass => array('name' => '1.8', )), array($modelClass => array('name' => '1.8')),
array($modelClass => array('name' => '1.9', )), array($modelClass => array('name' => '1.9')),
array($modelClass => array('name' => '1.10', )), array($modelClass => array('name' => '1.10')),
array($modelClass => array('name' => '1.5', ))); array($modelClass => array('name' => '1.5')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -812,16 +812,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array( $expected = array(
array($modelClass => array('name' => '1.1', )), array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', )), array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.3', )), array($modelClass => array('name' => '1.3')),
array($modelClass => array('name' => '1.4', )), array($modelClass => array('name' => '1.4')),
array($modelClass => array('name' => '1.6', )), array($modelClass => array('name' => '1.6')),
array($modelClass => array('name' => '1.7', )), array($modelClass => array('name' => '1.7')),
array($modelClass => array('name' => '1.5', )), array($modelClass => array('name' => '1.5')),
array($modelClass => array('name' => '1.8', )), array($modelClass => array('name' => '1.8')),
array($modelClass => array('name' => '1.9', )), array($modelClass => array('name' => '1.9')),
array($modelClass => array('name' => '1.10', ))); array($modelClass => array('name' => '1.10')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }
@ -842,16 +842,16 @@ class TreeBehaviorNumberTest extends CakeTestCase {
$this->Tree->id = $parent[$modelClass]['id']; $this->Tree->id = $parent[$modelClass]['id'];
$result = $this->Tree->children(null, true, array('name')); $result = $this->Tree->children(null, true, array('name'));
$expected = array( $expected = array(
array($modelClass => array('name' => '1.1', )), array($modelClass => array('name' => '1.1')),
array($modelClass => array('name' => '1.2', )), array($modelClass => array('name' => '1.2')),
array($modelClass => array('name' => '1.3', )), array($modelClass => array('name' => '1.3')),
array($modelClass => array('name' => '1.4', )), array($modelClass => array('name' => '1.4')),
array($modelClass => array('name' => 'renamed', )), array($modelClass => array('name' => 'renamed')),
array($modelClass => array('name' => '1.6', )), array($modelClass => array('name' => '1.6')),
array($modelClass => array('name' => '1.7', )), array($modelClass => array('name' => '1.7')),
array($modelClass => array('name' => '1.8', )), array($modelClass => array('name' => '1.8')),
array($modelClass => array('name' => '1.9', )), array($modelClass => array('name' => '1.9')),
array($modelClass => array('name' => '1.10', ))); array($modelClass => array('name' => '1.10')));
$this->assertSame($expected, $result); $this->assertSame($expected, $result);
} }