Skip to content

Commit 8ccdf62

Browse files
committed
Merge pull request cakephp#1492 from dereuromark/master-phpcs
coding standards according to new sniffer rules
2 parents 19b4021 + e7e5f46 commit 8ccdf62

25 files changed

+80
-82
lines changed

lib/Cake/Test/Case/Cache/Engine/FileEngineTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -401,31 +401,31 @@ public function testMaskSetting() {
401401
Cache::config('mask_test', array('engine' => 'File', 'path' => TMP . 'tests'));
402402
$data = 'This is some test content';
403403
$write = Cache::write('masking_test', $data, 'mask_test');
404-
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
404+
$result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
405405
$expected = '0664';
406406
$this->assertEquals($expected, $result);
407407
Cache::delete('masking_test', 'mask_test');
408408
Cache::drop('mask_test');
409409

410410
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0666, 'path' => TMP . 'tests'));
411411
$write = Cache::write('masking_test', $data, 'mask_test');
412-
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
412+
$result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
413413
$expected = '0666';
414414
$this->assertEquals($expected, $result);
415415
Cache::delete('masking_test', 'mask_test');
416416
Cache::drop('mask_test');
417417

418418
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0644, 'path' => TMP . 'tests'));
419419
$write = Cache::write('masking_test', $data, 'mask_test');
420-
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
420+
$result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
421421
$expected = '0644';
422422
$this->assertEquals($expected, $result);
423423
Cache::delete('masking_test', 'mask_test');
424424
Cache::drop('mask_test');
425425

426426
Cache::config('mask_test', array('engine' => 'File', 'mask' => 0640, 'path' => TMP . 'tests'));
427427
$write = Cache::write('masking_test', $data, 'mask_test');
428-
$result = substr(sprintf('%o',fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
428+
$result = substr(sprintf('%o', fileperms(TMP . 'tests' . DS . 'cake_masking_test')), -4);
429429
$expected = '0640';
430430
$this->assertEquals($expected, $result);
431431
Cache::delete('masking_test', 'mask_test');

lib/Cake/Test/Case/Core/ObjectTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ public function testRequestActionParamParseAndPass() {
598598
$this->assertEquals(null, $result['plugin']);
599599

600600
$result = $this->object->requestAction('/request_action/params_pass/sort:desc/limit:5');
601-
$expected = array('sort' => 'desc', 'limit' => 5,);
601+
$expected = array('sort' => 'desc', 'limit' => 5);
602602
$this->assertEquals($expected, $result['named']);
603603

604604
$result = $this->object->requestAction(

lib/Cake/Test/Case/Error/ExceptionRendererTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public static function testProvider() {
528528
404
529529
),
530530
array(
531-
new PrivateActionException(array('controller' => 'PostsController' , 'action' => '_secretSauce')),
531+
new PrivateActionException(array('controller' => 'PostsController', 'action' => '_secretSauce')),
532532
array(
533533
'/<h2>Private Method in PostsController<\/h2>/',
534534
'/<em>PostsController::<\/em><em>_secretSauce\(\)<\/em>/'

lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ public function testArrayConditionsParsing() {
24072407
$this->assertEquals($expected, $result);
24082408

24092409
$result = $this->Dbo->conditions(array(
2410-
'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912,999)),
2410+
'NOT' => array('Course.id' => null, 'Course.vet' => 'N', 'level_of_education_id' => array(912, 999)),
24112411
'Enrollment.yearcompleted >' => '0')
24122412
);
24132413
$this->assertRegExp('/^\s*WHERE\s+\(NOT\s+\(`Course`\.`id` IS NULL\)\s+AND NOT\s+\(`Course`\.`vet`\s+=\s+\'N\'\)\s+AND NOT\s+\(`level_of_education_id` IN \(912, 999\)\)\)\s+AND\s+`Enrollment`\.`yearcompleted`\s+>\s+\'0\'\s*$/', $result);
@@ -3267,7 +3267,7 @@ public function testVirtualFieldsInConditions() {
32673267
$expected = '(1 + 1) = 2';
32683268
$this->assertEquals($expected, $result);
32693269

3270-
$conditions = array('this_moment BETWEEN ? AND ?' => array(1,2));
3270+
$conditions = array('this_moment BETWEEN ? AND ?' => array(1, 2));
32713271
$expected = 'NOW() BETWEEN 1 AND 2';
32723272
$result = $this->Dbo->conditions($conditions, true, false, $Article);
32733273
$this->assertEquals($expected, $result);

lib/Cake/Test/Case/Model/ModelIntegrationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -836,16 +836,16 @@ public function testHABTMKeepExistingWithThreeDbs() {
836836
$this->assertEquals('test_database_three', $Player->ArmorsPlayer->useDbConfig);
837837

838838
$players = $Player->find('all');
839-
$this->assertEquals(4 , count($players));
839+
$this->assertEquals(4, count($players));
840840
$playersGuilds = Hash::extract($players, '{n}.Guild.{n}.GuildsPlayer');
841-
$this->assertEquals(3 , count($playersGuilds));
841+
$this->assertEquals(3, count($playersGuilds));
842842
$playersArmors = Hash::extract($players, '{n}.Armor.{n}.ArmorsPlayer');
843-
$this->assertEquals(3 , count($playersArmors));
843+
$this->assertEquals(3, count($playersArmors));
844844
unset($players);
845845

846846
$larry = $Player->findByName('larry');
847847
$larrysArmor = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer');
848-
$this->assertEquals(1 , count($larrysArmor));
848+
$this->assertEquals(1, count($larrysArmor));
849849

850850
$larry['Guild']['Guild'] = array(1, 3); // larry joins another guild
851851
$larry['Armor']['Armor'] = array(2, 3); // purchases chainmail
@@ -854,9 +854,9 @@ public function testHABTMKeepExistingWithThreeDbs() {
854854

855855
$larry = $Player->findByName('larry');
856856
$larrysGuild = Hash::extract($larry, 'Guild.{n}.GuildsPlayer');
857-
$this->assertEquals(2 , count($larrysGuild));
857+
$this->assertEquals(2, count($larrysGuild));
858858
$larrysArmor = Hash::extract($larry, 'Armor.{n}.ArmorsPlayer');
859-
$this->assertEquals(2 , count($larrysArmor));
859+
$this->assertEquals(2, count($larrysArmor));
860860

861861
$Player->ArmorsPlayer->id = 3;
862862
$Player->ArmorsPlayer->saveField('broken', true); // larry's cloak broke

lib/Cake/Test/Case/Model/ModelWriteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4941,7 +4941,7 @@ public function testSaveAssociatedAtomicFalseValidateFirstWithErrors() {
49414941
$expected = array(
49424942
'Comment' => array(
49434943
array(
4944-
'comment' => array( 'This field cannot be left blank' )
4944+
'comment' => array('This field cannot be left blank')
49454945
)
49464946
)
49474947
);

lib/Cake/Test/Case/Network/Email/CakeEmailTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,7 +1669,7 @@ public function testBodyEncoding() {
16691669
$email->to('[email protected]')->from('[email protected]');
16701670
$result = $email->send('ってテーブルを作ってやってたらう');
16711671
$this->assertContains('Content-Type: text/plain; charset=ISO-2022-JP', $result['headers']);
1672-
$this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう','ISO-2022-JP'), $result['message']);
1672+
$this->assertContains(mb_convert_encoding('ってテーブルを作ってやってたらう', 'ISO-2022-JP'), $result['message']);
16731673
}
16741674

16751675
/**
@@ -1693,7 +1693,7 @@ public function testBodyEncodingIso2022Jp() {
16931693
$result = $email->send('①㈱');
16941694
$this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']);
16951695
$this->assertTextNotContains("Content-Type: text/plain; charset=ISO-2022-JP-MS", $result['headers']); // not charset=iso-2022-jp-ms
1696-
$this->assertTextNotContains(mb_convert_encoding('①㈱','ISO-2022-JP-MS'), $result['message']);
1696+
$this->assertTextNotContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
16971697
}
16981698

16991699
/**
@@ -1717,7 +1717,7 @@ public function testBodyEncodingIso2022JpMs() {
17171717
$result = $email->send('①㈱');
17181718
$this->assertTextContains("Content-Type: text/plain; charset=ISO-2022-JP", $result['headers']);
17191719
$this->assertTextNotContains("Content-Type: text/plain; charset=iso-2022-jp-ms", $result['headers']); // not charset=iso-2022-jp-ms
1720-
$this->assertContains(mb_convert_encoding('①㈱','ISO-2022-JP-MS'), $result['message']);
1720+
$this->assertContains(mb_convert_encoding('①㈱', 'ISO-2022-JP-MS'), $result['message']);
17211721
}
17221722

17231723
protected function _checkContentTransferEncoding($message, $charset) {

lib/Cake/Test/Case/Network/Http/HttpSocketTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,8 @@ public function testParseQuery() {
15201520
'name' => 'jim',
15211521
'items' => array(
15221522
'personal' => array(
1523-
'book'
1524-
, 'pen'
1523+
'book',
1524+
'pen'
15251525
),
15261526
'ball'
15271527
)
@@ -1608,10 +1608,10 @@ public function testTokenEscapeChars() {
16081608
$this->Socket->reset();
16091609

16101610
$expected = array(
1611-
'\x22','\x28','\x29','\x3c','\x3e','\x40','\x2c','\x3b','\x3a','\x5c','\x2f','\x5b','\x5d','\x3f','\x3d','\x7b',
1612-
'\x7d','\x20','\x00','\x01','\x02','\x03','\x04','\x05','\x06','\x07','\x08','\x09','\x0a','\x0b','\x0c','\x0d',
1613-
'\x0e','\x0f','\x10','\x11','\x12','\x13','\x14','\x15','\x16','\x17','\x18','\x19','\x1a','\x1b','\x1c','\x1d',
1614-
'\x1e','\x1f','\x7f'
1611+
'\x22', '\x28', '\x29', '\x3c', '\x3e', '\x40', '\x2c', '\x3b', '\x3a', '\x5c', '\x2f', '\x5b', '\x5d', '\x3f', '\x3d', '\x7b',
1612+
'\x7d', '\x20', '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07', '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d',
1613+
'\x0e', '\x0f', '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17', '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d',
1614+
'\x1e', '\x1f', '\x7f'
16151615
);
16161616
$r = $this->Socket->tokenEscapeChars();
16171617
$this->assertEquals($expected, $r);

lib/Cake/Test/Case/Routing/Route/CakeRouteTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ public function testParseTrailingUTF8() {
923923
public function testUTF8PatternOnSection() {
924924
$route = new CakeRoute(
925925
'/:section',
926-
array('plugin' => 'blogs', 'controller' => 'posts' , 'action' => 'index' ),
926+
array('plugin' => 'blogs', 'controller' => 'posts', 'action' => 'index'),
927927
array(
928928
'persist' => array('section'),
929929
'section' => 'آموزش|weblog'

lib/Cake/Test/Case/Routing/RouterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ public function testCanLeavePlugin() {
944944
public function testUrlParsing() {
945945
extract(Router::getNamedExpressions());
946946

947-
Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value','somevalue', 'othervalue'));
947+
Router::connect('/posts/:value/:somevalue/:othervalue/*', array('controller' => 'posts', 'action' => 'view'), array('value', 'somevalue', 'othervalue'));
948948
$result = Router::parse('/posts/2007/08/01/title-of-post-here');
949949
$expected = array('value' => '2007', 'somevalue' => '08', 'othervalue' => '01', 'controller' => 'posts', 'action' => 'view', 'plugin' => '', 'pass' => array('0' => 'title-of-post-here'), 'named' => array());
950950
$this->assertEquals($expected, $result);

0 commit comments

Comments
 (0)