Skip to content

Commit

Permalink
Fix some phpcs issues after latest phpcs 3.5.5 release
Browse files Browse the repository at this point in the history
I left the false positives unfixed: squizlabs/PHP_CodeSniffer#2937 (comment)
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Apr 17, 2020
1 parent 7ede0d8 commit 62a6591
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 40 deletions.
15 changes: 10 additions & 5 deletions libraries/classes/Font.php
Expand Up @@ -33,7 +33,8 @@ public function getCharLists(): array
"i",
"j",
"l",
], "modifier" => 0.23,
],
"modifier" => 0.23,
];
//f
$charLists[] = [
Expand All @@ -45,7 +46,8 @@ public function getCharLists(): array
"chars" => [
"t",
"I",
], "modifier" => 0.28,
],
"modifier" => 0.28,
];
//r
$charLists[] = [
Expand Down Expand Up @@ -104,7 +106,8 @@ public function getCharLists(): array
"F",
"T",
"Z",
], "modifier" => 0.61,
],
"modifier" => 0.61,
];
//ABEKPSVXY
$charLists[] = [
Expand Down Expand Up @@ -140,14 +143,16 @@ public function getCharLists(): array
"G",
"O",
"Q",
], "modifier" => 0.78,
],
"modifier" => 0.78,
];
//mM
$charLists[] = [
"chars" => [
"m",
"M",
], "modifier" => 0.84,
],
"modifier" => 0.84,
];
//W
$charLists[] = [
Expand Down
3 changes: 2 additions & 1 deletion libraries/classes/Server/Privileges.php
Expand Up @@ -269,7 +269,8 @@ function ($val) {
&& (! isset($_POST['grant_count']) || count($privs) == $_POST['grant_count'])
) {
if ($enableHTML) {
$privs = ['<dfn title="'
$privs = [
'<dfn title="'
. __('Includes all privileges except GRANT.')
. '">ALL PRIVILEGES</dfn>',
];
Expand Down
18 changes: 10 additions & 8 deletions test/classes/Controllers/Database/StructureControllerTest.php
Expand Up @@ -416,10 +416,11 @@ public function testSynchronizeFavoriteTables()
->will($this->returnValue([]));
$favoriteInstance->expects($this->at(2))
->method('getTables')
->will($this->returnValue([[
'db' => 'db',
'table' => 'table',
],
->will($this->returnValue([
[
'db' => 'db',
'table' => 'table',
],
]));

$class = new ReflectionClass(StructureController::class);
Expand Down Expand Up @@ -488,10 +489,11 @@ public function testHandleRealRowCountRequestAction()
'real_row_count_all' => 'abc',
]);

$expectedResult = [[
'table' => 'table',
'row_count' => 6,
],
$expectedResult = [
[
'table' => 'table',
'row_count' => 6,
],
];
$this->assertEquals(
json_encode($expectedResult),
Expand Down
18 changes: 12 additions & 6 deletions test/classes/CoreTest.php
Expand Up @@ -81,7 +81,8 @@ public function testArrayRead()
'a',
'b',
'c',
], 4,
],
4,
],
],
];
Expand Down Expand Up @@ -184,7 +185,8 @@ public function testArrayWrite()
'a',
'b',
'c',
], 4,
],
4,
],
],
];
Expand Down Expand Up @@ -253,7 +255,8 @@ public function testArrayRemove()
'a',
'b',
'c',
], 4,
],
4,
],
],
];
Expand Down Expand Up @@ -909,7 +912,8 @@ public static function providerTestNoVarType()
1,
2,
3,
], false,
],
false,
null,
],
[
Expand Down Expand Up @@ -1212,7 +1216,8 @@ public function provideTestSimilarType()
1,
2,
3.4,
], [
],
[
1,
2,
3.4,
Expand All @@ -1225,7 +1230,8 @@ public function provideTestSimilarType()
'3.4',
5,
'text',
], [
],
[
'1',
'2',
3.4,
Expand Down
12 changes: 8 additions & 4 deletions test/classes/ImportTest.php
Expand Up @@ -360,28 +360,32 @@ public function provGetDecimalSize()
2,
1,
'2,1',
], '2.1',
],
'2.1',
],
[
[
2,
1,
'2,1',
], '6.2',
],
'6.2',
],
[
[
3,
1,
'3,1',
], '10.0',
],
'10.0',
],
[
[
4,
2,
'4,2',
], '30.20',
],
'30.20',
],
];
}
Expand Down
9 changes: 5 additions & 4 deletions test/classes/NormalizationTest.php
Expand Up @@ -85,10 +85,11 @@ protected function setUp(): void
'PMA_db',
'PMA_table',
DatabaseInterface::CONNECT_USER,
[[
'Key_name' => 'PRIMARY',
'Column_name' => 'id',
],
[
[
'Key_name' => 'PRIMARY',
'Column_name' => 'id',
],
],
],
[
Expand Down
21 changes: 14 additions & 7 deletions test/classes/TableTest.php
Expand Up @@ -972,15 +972,17 @@ public function testIsMergeCase2()
[
'PMA',
'PMA_BookMark',
], null,
],
null,
['ENGINE' => "MERGE"],
],
[
[
'PMA',
'PMA_BookMark',
'ENGINE',
], null,
],
null,
"MERGE",
],
];
Expand All @@ -1007,15 +1009,17 @@ public function testIsMergeCase3()
[
'PMA',
'PMA_BookMark',
], null,
],
null,
['ENGINE' => "MRG_MYISAM"],
],
[
[
'PMA',
'PMA_BookMark',
'ENGINE',
], null,
],
null,
"MRG_MYISAM",
],
];
Expand All @@ -1042,15 +1046,17 @@ public function testIsMergeCase4()
[
'PMA',
'PMA_BookMark',
], null,
],
null,
['ENGINE' => "ISDB"],
],
[
[
'PMA',
'PMA_BookMark',
'ENGINE',
], null,
],
null,
"ISDB",
],
];
Expand Down Expand Up @@ -1474,7 +1480,8 @@ public function testCountRecords()
'PMA',
'PMA_BookMark',
'TABLE_TYPE',
], null,
],
null,
'VIEW',
],
];
Expand Down
11 changes: 6 additions & 5 deletions test/classes/TwoFactorTest.php
Expand Up @@ -259,11 +259,12 @@ public function testKeyAuthentication()
$_POST['u2f_authentication_response'] = '';
$this->assertFalse($object->check(true));

$_SESSION['authenticationRequest'] = [new SignRequest([
'challenge' => 'fEnc9oV79EaBgK5BoNERU5gPKM2XGYWrz4fUjgc0Q7g',
'keyHandle' => 'CTUayZo8hCBeC-sGQJChC0wW-bBg99bmOlGCgw8XGq4dLsxO3yWh9mRYArZxocP5hBB1pEGB3bbJYiM-5acc5w',
'appId' => 'http://demo.example.com',
]),
$_SESSION['authenticationRequest'] = [
new SignRequest([
'challenge' => 'fEnc9oV79EaBgK5BoNERU5gPKM2XGYWrz4fUjgc0Q7g',
'keyHandle' => 'CTUayZo8hCBeC-sGQJChC0wW-bBg99bmOlGCgw8XGq4dLsxO3yWh9mRYArZxocP5hBB1pEGB3bbJYiM-5acc5w',
'appId' => 'http://demo.example.com',
]),
];
$this->assertFalse($object->check(true));
$_POST['u2f_authentication_response'] = '{ "signatureData": "AQAAAAQwRQIhAI6FSrMD3KUUtkpiP0jpIEakql-HNhwWFngyw553pS1CAiAKLjACPOhxzZXuZsVO8im-HStEcYGC50PKhsGp_SUAng==", "clientData": "eyAiY2hhbGxlbmdlIjogImZFbmM5b1Y3OUVhQmdLNUJvTkVSVTVnUEtNMlhHWVdyejRmVWpnYzBRN2ciLCAib3JpZ2luIjogImh0dHA6XC9cL2RlbW8uZXhhbXBsZS5jb20iLCAidHlwIjogIm5hdmlnYXRvci5pZC5nZXRBc3NlcnRpb24iIH0=", "keyHandle": "CTUayZo8hCBeC-sGQJChC0wW-bBg99bmOlGCgw8XGq4dLsxO3yWh9mRYArZxocP5hBB1pEGB3bbJYiM-5acc5w", "errorCode": 0 }';
Expand Down

0 comments on commit 62a6591

Please sign in to comment.