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:
Dylan K. Taylor
2019-02-22 12:53:07 +00:00
parent a5c260352d
commit 73a565355b
13 changed files with 13 additions and 13 deletions

View File

@ -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);
}

View File

@ -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;