Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Explicity mark nullable parameters for PHP 8.4 #662

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading