Skip to content

Commit

Permalink
Fix PHP 8.2 deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary authored Jan 28, 2023
1 parent 84edefd commit 3f53fe2
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 18 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ jobs:
matrix:
php-versions:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
- '8.2'
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
4 changes: 2 additions & 2 deletions src/Api/Utils/ApiUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static function serializeArrayOfArrays($arrayOfArrays)
return self::serializeSimpleApiParam($array);
}

$array = array_map('self::serializeSimpleApiParam', $array);
$array = array_map(self::class . '::serializeSimpleApiParam', $array);


return self::serializeParameter($array, self::ARRAY_OF_ARRAYS_DELIMITER);
Expand Down Expand Up @@ -274,7 +274,7 @@ public static function serializeQueryParams($parameters = [])
*/
public static function signParameters($parameters, $secret, $signatureAlgorithm = Utils::ALGO_SHA1)
{
$parameters = array_map('self::serializeSimpleApiParam', $parameters);
$parameters = array_map(self::class . '::serializeSimpleApiParam', $parameters);

ksort($parameters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,10 @@ protected static function assertValidSubAccountUser($user, $values = [])
[
'id' => IsType::TYPE_STRING,
'name' => IsType::TYPE_STRING,
'description' => [IsType::TYPE_STRING, IsType::TYPE_NULL],
'cloud_name' => IsType::TYPE_STRING,
'api_access_keys' => IsType::TYPE_ARRAY,
'enabled' => IsType::TYPE_BOOL,
'created_at' => IsType::TYPE_STRING,
'custom_attributes' => [IsType::TYPE_ARRAY, IsType::TYPE_NULL]
'created_at' => IsType::TYPE_STRING
]
);

Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Tag/TagFromParamsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ public function testVideoTagFetch()
$prefixUrl = self::VIDEO_FETCH_PATH;

self::assertStrEquals(
"<video poster='${prefixUrl}f_jpg/$videoUrl'>" .
"<source src='${prefixUrl}f_webm/$videoUrl' type='video/webm'>" .
"<source src='${prefixUrl}f_mp4/$videoUrl' type='video/mp4'>" .
"<source src='${prefixUrl}f_ogv/$videoUrl' type='video/ogg'>" .
"<video poster='{$prefixUrl}f_jpg/$videoUrl'>" .
"<source src='{$prefixUrl}f_webm/$videoUrl' type='video/webm'>" .
"<source src='{$prefixUrl}f_mp4/$videoUrl' type='video/mp4'>" .
"<source src='{$prefixUrl}f_ogv/$videoUrl' type='video/ogg'>" .
'</video>',
VideoTag::fromParams($videoUrl, [DeliveryType::KEY => DeliveryType::FETCH])
);
Expand Down
10 changes: 5 additions & 5 deletions tests/Unit/Tag/VideoTagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ public function testVideoTagFetchVideo()
$videoUrl = self::FETCH_VIDEO_URL;
$prefixUrl = self::FETCH_VIDEO_URL_PREFIX;

$expected = "<video poster=\"${prefixUrl}f_jpg/$videoUrl\">" . "\n" .
"<source src=\"${prefixUrl}f_mp4/vc_h265/$videoUrl\" type=\"video/mp4; codecs=hev1\">" . "\n" .
"<source src=\"${prefixUrl}f_webm/vc_vp9/$videoUrl\" type=\"video/webm; codecs=vp9\">" . "\n" .
"<source src=\"${prefixUrl}f_mp4/vc_auto/$videoUrl\" type=\"video/mp4\">" . "\n" .
"<source src=\"${prefixUrl}f_webm/vc_auto/$videoUrl\" type=\"video/webm\">" . "\n" .
$expected = "<video poster=\"{$prefixUrl}f_jpg/$videoUrl\">" . "\n" .
"<source src=\"{$prefixUrl}f_mp4/vc_h265/$videoUrl\" type=\"video/mp4; codecs=hev1\">" . "\n" .
"<source src=\"{$prefixUrl}f_webm/vc_vp9/$videoUrl\" type=\"video/webm; codecs=vp9\">" . "\n" .
"<source src=\"{$prefixUrl}f_mp4/vc_auto/$videoUrl\" type=\"video/mp4\">" . "\n" .
"<source src=\"{$prefixUrl}f_webm/vc_auto/$videoUrl\" type=\"video/webm\">" . "\n" .
'</video>';

self::assertStrEquals(
Expand Down

0 comments on commit 3f53fe2

Please sign in to comment.