From a9ef88433ec994c1b60ba307a6958c61e4b5b24b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leszek=20Mas=C5=82owski?= Date: Mon, 3 Oct 2022 19:46:57 +0200 Subject: [PATCH 1/2] Update composer.json to work with PHP8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8eb45da..3a2048b 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.2", + "php": ">=7.2", "symfony/process": "^4.2|^5.0" }, "require-dev": { From 857a2177c630b4bbc6cf55531c996348463e0fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leszek=20Mas=C5=82owski?= Date: Thu, 23 Apr 2026 13:58:53 +0200 Subject: [PATCH 2/2] Add explicit nullable types for PHP 8.4 compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implicit-nullable parameters are deprecated in PHP 8.4 and become hard errors in PHP 9. Add ? prefix to 7 parameter type hints across helpers.php, Media/MediaInterface.php, and Media/Media.php. No behaviour change — PHP's implicit nullable for default=null has always been equivalent to explicit ?T. --- src/Media/Media.php | 6 +++--- src/Media/MediaInterface.php | 6 +++--- src/helpers.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Media/Media.php b/src/Media/Media.php index 19bef64..2d66923 100644 --- a/src/Media/Media.php +++ b/src/Media/Media.php @@ -26,7 +26,7 @@ class Media extends ExportMedia implements MediaInterface * @return Media * @throws MediaException */ - public function DRM(string $encryption, callable $options = null) + public function DRM(string $encryption, ?callable $options = null) { $class_name = '\Shaka\Options\DRM\\' . ucwords($encryption); @@ -47,7 +47,7 @@ public function DRM(string $encryption, callable $options = null) * @return $this * @throws MediaException */ - public function HLS(string $output, callable $options = null) + public function HLS(string $output, ?callable $options = null) { $hls = new HLS(); $hls = $hls->HLSMasterPlaylistOutput($output); @@ -62,7 +62,7 @@ public function HLS(string $output, callable $options = null) * @return $this * @throws MediaException */ - public function DASH(string $output, callable $options = null) + public function DASH(string $output, ?callable $options = null) { $dash = new DASH(); $dash = $dash->mpdOutput($output); diff --git a/src/Media/MediaInterface.php b/src/Media/MediaInterface.php index 8aee538..870220a 100644 --- a/src/Media/MediaInterface.php +++ b/src/Media/MediaInterface.php @@ -22,19 +22,19 @@ interface MediaInterface * @param callable|null $options * @return $this */ - public function DASH(string $output, callable $options = null); + public function DASH(string $output, ?callable $options = null); /** * @param string $output * @param callable|null $options * @return $this */ - public function HLS(string $output, callable $options = null); + public function HLS(string $output, ?callable $options = null); /** * @param string $encryption * @param callable|null $options * @return Media */ - public function DRM(string $encryption, callable $options = null); + public function DRM(string $encryption, ?callable $options = null); } \ No newline at end of file diff --git a/src/helpers.php b/src/helpers.php index d25cfcd..c72a3f9 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -17,7 +17,7 @@ * @return mixed * @throws \Shaka\Exception\ProcessException */ - function shaka(string $binary = null) + function shaka(?string $binary = null) { return \Shaka\Shaka::initialize($binary); }