From 052c00d66bd218bb8f1ed5cfbb491c89b9f2c9bf Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 28 Nov 2024 14:02:23 +1300 Subject: [PATCH] API Explicity mark nullable parameters for PHP 8.4 --- src/FileDefaultPermissions.php | 8 ++++---- src/Flysystem/Filesystem.php | 2 +- src/Flysystem/LocalFilesystemAdapter.php | 4 ++-- src/Image_Backend.php | 2 +- src/InterventionBackend.php | 2 +- src/Shortcodes/FileLinkTracking.php | 2 +- src/Storage/DBFile.php | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/FileDefaultPermissions.php b/src/FileDefaultPermissions.php index caa6dda4..defc19ef 100644 --- a/src/FileDefaultPermissions.php +++ b/src/FileDefaultPermissions.php @@ -17,7 +17,7 @@ class FileDefaultPermissions implements DefaultPermissionChecker * @param Member $member * @return bool */ - public function canEdit(Member $member = null) + public function canEdit(?Member $member = null) { return Permission::checkMember($member, File::EDIT_ALL); } @@ -28,7 +28,7 @@ public function canEdit(Member $member = null) * @param Member $member * @return bool */ - public function canView(Member $member = null) + public function canView(?Member $member = null) { return true; } @@ -39,7 +39,7 @@ public function canView(Member $member = null) * @param Member $member * @return bool */ - public function canDelete(Member $member = null) + public function canDelete(?Member $member = null) { return $this->canEdit($member); } @@ -50,7 +50,7 @@ public function canDelete(Member $member = null) * @param Member $member * @return bool */ - public function canCreate(Member $member = null) + public function canCreate(?Member $member = null) { return $this->canEdit($member); } diff --git a/src/Flysystem/Filesystem.php b/src/Flysystem/Filesystem.php index 7c4850b2..f816ba0c 100644 --- a/src/Flysystem/Filesystem.php +++ b/src/Flysystem/Filesystem.php @@ -15,7 +15,7 @@ class Filesystem extends LeagueFilesystem public function __construct( FilesystemAdapter $adapter, array $config = [], - PathNormalizer $pathNormalizer = null + ?PathNormalizer $pathNormalizer = null ) { $this->adapter = $adapter; $this->pathNormalizer = $pathNormalizer ?: new WhitespacePathNormalizer(); diff --git a/src/Flysystem/LocalFilesystemAdapter.php b/src/Flysystem/LocalFilesystemAdapter.php index 6132914d..262e7e79 100644 --- a/src/Flysystem/LocalFilesystemAdapter.php +++ b/src/Flysystem/LocalFilesystemAdapter.php @@ -13,10 +13,10 @@ class LocalFilesystemAdapter extends LeagueLocalFilesystemAdapter public function __construct( string $location, - VisibilityConverter $visibility = null, + ?VisibilityConverter $visibility = null, int $writeFlags = LOCK_EX, int $linkHandling = LocalFilesystemAdapter::DISALLOW_LINKS, - MimeTypeDetector $mimeTypeDetector = null + ?MimeTypeDetector $mimeTypeDetector = null ) { $this->pathPrefixer = new PathPrefixer($location); diff --git a/src/Image_Backend.php b/src/Image_Backend.php index 14885ace..8ee7da72 100644 --- a/src/Image_Backend.php +++ b/src/Image_Backend.php @@ -33,7 +33,7 @@ interface Image_Backend * * @param AssetContainer $assetContainer Object to load from */ - public function __construct(AssetContainer $assetContainer = null); + public function __construct(?AssetContainer $assetContainer = null); /** * Get the width of the image diff --git a/src/InterventionBackend.php b/src/InterventionBackend.php index befc502e..bb5f2bd5 100644 --- a/src/InterventionBackend.php +++ b/src/InterventionBackend.php @@ -87,7 +87,7 @@ class InterventionBackend implements Image_Backend, Flushable private ?string $tempPath = null; - public function __construct(AssetContainer $assetContainer = null) + public function __construct(?AssetContainer $assetContainer = null) { $this->setAssetContainer($assetContainer); } diff --git a/src/Shortcodes/FileLinkTracking.php b/src/Shortcodes/FileLinkTracking.php index 76323831..6d3ba726 100644 --- a/src/Shortcodes/FileLinkTracking.php +++ b/src/Shortcodes/FileLinkTracking.php @@ -78,7 +78,7 @@ public function getFileParser() * @param FileLinkTrackingParser $parser * @return $this */ - public function setFileParser(FileLinkTrackingParser $parser = null) + public function setFileParser(?FileLinkTrackingParser $parser = null) { $this->fileParser = $parser; return $this; diff --git a/src/Storage/DBFile.php b/src/Storage/DBFile.php index f4984c26..794a30ad 100644 --- a/src/Storage/DBFile.php +++ b/src/Storage/DBFile.php @@ -89,7 +89,7 @@ class DBFile extends DBComposite implements AssetContainer, Thumbnail * * @param array|string $allowed List of allowed file categories (not extensions), as per File::$app_categories */ - public function __construct(string $name = null, array|string $allowed = []) + public function __construct(?string $name = null, array|string $allowed = []) { parent::__construct($name); $this->setAllowedCategories($allowed);