Suppress some PHP 8.1 deprecations

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2021-08-21 17:44:21 -03:00
parent e927ebec4c
commit 30fac275c5
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
8 changed files with 17 additions and 10 deletions

View File

@ -154,7 +154,7 @@ class GisMultiPolygon extends GisGeometry
}
}
// draw polygon
imagefilledpolygon($image, $points_arr, count($points_arr) / 2, $color);
@imagefilledpolygon($image, $points_arr, count($points_arr) / 2, $color);
// mark label point if applicable
if (isset($label) && trim($label) != '' && $first_poly) {
$label_point = [

View File

@ -145,7 +145,7 @@ class GisPolygon extends GisGeometry
}
// draw polygon
imagefilledpolygon($image, $points_arr, count($points_arr) / 2, $color);
@imagefilledpolygon($image, $points_arr, count($points_arr) / 2, $color);
// print label if applicable
if (isset($label) && trim($label) != '') {
imagestring(

View File

@ -47,7 +47,7 @@ EOT;
. '<meta:generator>phpMyAdmin ' . PMA_VERSION . '</meta:generator>'
. '<meta:initial-creator>phpMyAdmin ' . PMA_VERSION
. '</meta:initial-creator>'
. '<meta:creation-date>' . strftime('%Y-%m-%dT%H:%M:%S')
. '<meta:creation-date>' . @strftime('%Y-%m-%dT%H:%M:%S')
. '</meta:creation-date>'
. '</office:meta>'
. '</office:document-meta>',

View File

@ -97,11 +97,13 @@ abstract class OptionsPropertyGroup extends OptionsPropertyItem implements Count
return count($this->properties);
}
// phpcs:disable SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly, Squiz.WhiteSpace.FunctionSpacing
/**
* Countable interface implementation.
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->getNrOfProperties();

View File

@ -793,12 +793,12 @@ class Util
$date = (string) preg_replace(
'@%[aA]@',
$day_of_week[(int) strftime('%w', (int) $timestamp)],
$day_of_week[(int) @strftime('%w', (int) $timestamp)],
$format
);
$date = (string) preg_replace(
'@%[bB]@',
$month[(int) strftime('%m', (int) $timestamp) - 1],
$month[(int) @strftime('%m', (int) $timestamp) - 1],
$date
);
@ -813,7 +813,7 @@ class Util
// Can return false on windows for Japanese language
// See https://github.com/phpmyadmin/phpmyadmin/issues/15830
$ret = strftime($date, (int) $timestamp);
$ret = @strftime($date, (int) $timestamp);
// Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8
// output here. See https://github.com/phpmyadmin/phpmyadmin/issues/10598
if ($ret === false
@ -1933,7 +1933,7 @@ class Util
}
/* Do the replacement */
return strtr((string) strftime($string), $replace);
return strtr((string) @strftime($string), $replace);
}
/**

View File

@ -265,6 +265,11 @@ parameters:
count: 1
path: libraries/classes/Controllers/Table/SearchController.php
-
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Table\\\\StructureController\\:\\:extractPartitionDetails\\(\\) should return array\\<array\\>\\|null but returns array\\<string, array\\<int, array\\<string, mixed\\>\\>\\|bool\\|int\\|string\\>\\.$#"
count: 1
path: libraries/classes/Controllers/Table/StructureController.php
-
message: "#^Parameter \\#1 \\$content of method PhpMyAdmin\\\\Response\\:\\:addHTML\\(\\) expects string, PhpMyAdmin\\\\Message given\\.$#"
count: 1

View File

@ -8,10 +8,10 @@
verbose="true">
<testsuites>
<testsuite name="Classes">
<testsuite name="unit">
<directory suffix="Test.php">test/classes</directory>
</testsuite>
<testsuite name="Selenium">
<testsuite name="selenium">
<directory suffix="Test.php">test/selenium</directory>
</testsuite>
</testsuites>

View File

@ -2779,7 +2779,7 @@
<code>$max_unit</code>
</PossiblyNullArrayAccess>
<RedundantCast occurrences="1">
<code>(string) strftime($string)</code>
<code>(string) @strftime($string)</code>
</RedundantCast>
<RedundantCastGivenDocblockType occurrences="8">
<code>(int) $timestamp</code>