Skip to content

Commit

Permalink
API Explicity mark nullable parameters for PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Nov 28, 2024
1 parent 8293e01 commit bae5acd
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/FileDefaultPermissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand 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;
}
Expand All @@ -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);
}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Flysystem/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions src/Flysystem/LocalFilesystemAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/Image_Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/InterventionBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Shortcodes/FileLinkTracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/DBFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bae5acd

Please sign in to comment.