mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Make some forced-optional nullable parameters non-optional, PHP 7.1 style
these parameters did not make any sense to be optional, but were forced to be this way because of the way nullable types worked before 7.1.
This commit is contained in:
@ -90,7 +90,7 @@ class BanEntry{
|
||||
* @param \DateTime|null $date
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
public function setExpires(\DateTime $date = null){
|
||||
public function setExpires(?\DateTime $date){
|
||||
if($date !== null){
|
||||
self::validateDate($date);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class PermissionAttachmentInfo{
|
||||
*
|
||||
* @throws \InvalidStateException
|
||||
*/
|
||||
public function __construct(Permissible $permissible, string $permission, PermissionAttachment $attachment = null, bool $value){
|
||||
public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){
|
||||
$this->permissible = $permissible;
|
||||
$this->permission = $permission;
|
||||
$this->attachment = $attachment;
|
||||
|
Reference in New Issue
Block a user