Skip to content

Commit d76b240

Browse files
kamil-tekielaMauricioFauth
authored andcommitted
Remove redundant pass-by-ref
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 2b32209 commit d76b240

8 files changed

Lines changed: 22 additions & 7 deletions

File tree

libraries/classes/Config/Validator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public static function getValidators(ConfigFile $cf)
126126
public static function validate(
127127
ConfigFile $cf,
128128
$validatorId,
129-
array &$values,
129+
array $values,
130130
$isPostSource
131131
) {
132132
// find validators

libraries/classes/Controllers/Table/StructureController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ protected function displayStructure(
195195
$row_comments = [];
196196
$extracted_columnspecs = [];
197197
$collations = [];
198-
foreach ($fields as &$field) {
198+
foreach ($fields as $field) {
199199
++$rownum;
200200
$columns_list[] = $field['Field'];
201201

libraries/classes/Core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static function getRealSize($size = 0): int
198198
* @param array $allowList allow list to check page against
199199
* @param bool $include whether the page is going to be included
200200
*/
201-
public static function checkPageValidity(&$page, array $allowList = [], $include = false): bool
201+
public static function checkPageValidity($page, array $allowList = [], $include = false): bool
202202
{
203203
if (empty($allowList)) {
204204
$allowList = ['index.php'];

libraries/classes/Git.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ private function extractDataFormTextBody(array $commit): array
415415
*
416416
* @return stdClass|null The commit body from the GitHub API
417417
*/
418-
private function isRemoteCommit(&$commit, bool &$isRemoteCommit, string $hash): ?stdClass
418+
private function isRemoteCommit($commit, bool &$isRemoteCommit, string $hash): ?stdClass
419419
{
420420
$httpRequest = new HttpRequest();
421421

libraries/classes/Mime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Mime
2626
*
2727
* @return string
2828
*/
29-
public static function detect(&$test)
29+
public static function detect($test)
3030
{
3131
$len = mb_strlen($test);
3232
if ($len >= 2 && $test[0] == chr(0xff) && $test[1] == chr(0xd8)) {

libraries/classes/Plugins/Import/ImportMediawiki.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ private function setTableHeaders(array &$table_headers, array $table_row): void
380380
*
381381
* @global string $db name of the database to import in
382382
*/
383-
private function executeImportTables(array &$tables, array &$analyses, array &$sqlStatements): void
383+
private function executeImportTables(array &$tables, array $analyses, array &$sqlStatements): void
384384
{
385385
// $db_name : The currently selected database name, if applicable
386386
// No backquotes

libraries/classes/Sanitize.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ public static function getJsValue($key, $value)
277277
*
278278
* @param string[] $allowList list of variables to allow
279279
*/
280-
public static function removeRequestVars(&$allowList): void
280+
public static function removeRequestVars($allowList): void
281281
{
282282
// do not check only $_REQUEST because it could have been overwritten
283283
// and use type casting because the variables could have become

phpstan-baseline.neon

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,16 @@ parameters:
21102110
count: 1
21112111
path: libraries/classes/Controllers/Table/FindReplaceController.php
21122112

2113+
-
2114+
message: "#^Parameter \\#1 \\$str of function mb_strlen expects string, string\\|null given\\.$#"
2115+
count: 1
2116+
path: libraries/classes/Controllers/Table/GetFieldController.php
2117+
2118+
-
2119+
message: "#^Parameter \\#1 \\$test of static method PhpMyAdmin\\\\Mime\\:\\:detect\\(\\) expects string, string\\|null given\\.$#"
2120+
count: 1
2121+
path: libraries/classes/Controllers/Table/GetFieldController.php
2122+
21132123
-
21142124
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
21152125
count: 1
@@ -9585,6 +9595,11 @@ parameters:
95859595
count: 1
95869596
path: test/classes/CoreTest.php
95879597

9598+
-
9599+
message: "#^Parameter \\#1 \\$page of static method PhpMyAdmin\\\\Core\\:\\:checkPageValidity\\(\\) expects string, string\\|null given\\.$#"
9600+
count: 1
9601+
path: test/classes/CoreTest.php
9602+
95889603
-
95899604
message: "#^Method PhpMyAdmin\\\\Tests\\\\CreateAddFieldTest\\:\\:providerGetColumnCreationQueryRequest\\(\\) return type has no value type specified in iterable type array\\.$#"
95909605
count: 1

0 commit comments

Comments
 (0)