From 4e3a7a6de2143984e794fbd2626464b2126051dd Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Tue, 17 Sep 2024 15:58:37 +0200 Subject: [PATCH] PHP 8.4: Implicitly nullable parameter declarations deprecated --- plugins/cache-redis/Predis/Client.php | 6 ++--- .../cache-redis/Predis/PubSub/Consumer.php | 2 +- .../Predis/Transaction/MultiExec.php | 2 +- plugins/login-oauth2/OAuth2/Client.php | 2 +- .../app/libraries/MailSo/Base/Collection.php | 4 ++-- .../MailSo/Base/StreamWrappers/Binary.php | 2 +- .../MailSo/Imap/Commands/Folders.php | 2 +- .../MailSo/Imap/Commands/Messages.php | 8 +++---- .../app/libraries/MailSo/Imap/Folder.php | 2 +- .../app/libraries/MailSo/Imap/ImapClient.php | 4 ++-- .../app/libraries/MailSo/Mail/MailClient.php | 4 ++-- .../v/0.0.0/app/libraries/OAuth2/Client.php | 2 +- .../libraries/RainLoop/Actions/UserAuth.php | 2 +- .../v/0.0.0/app/libraries/RainLoop/Api.php | 2 +- .../libraries/RainLoop/Providers/Domain.php | 2 +- .../0.0.0/app/libraries/RainLoop/Service.php | 2 +- .../0.0.0/app/libraries/snappymail/crypt.php | 24 +++++++++---------- .../app/libraries/snappymail/dav/client.php | 2 +- .../libraries/snappymail/http/exception.php | 2 +- .../libraries/snappymail/http/response.php | 2 +- .../app/libraries/snappymail/image/exif.php | 2 +- .../v/0.0.0/app/libraries/snappymail/jwt.php | 2 +- .../app/libraries/snappymail/stream/tar.php | 4 ++-- .../app/libraries/snappymail/stream/zip.php | 2 +- 24 files changed, 44 insertions(+), 44 deletions(-) diff --git a/plugins/cache-redis/Predis/Client.php b/plugins/cache-redis/Predis/Client.php index 0b4511a52..4257667bd 100644 --- a/plugins/cache-redis/Predis/Client.php +++ b/plugins/cache-redis/Predis/Client.php @@ -472,7 +472,7 @@ class Client implements ClientInterface, IteratorAggregate * * @return Pipeline|array */ - protected function createPipeline(array $options = null, $callable = null) + protected function createPipeline(?array $options = null, $callable = null) { if (isset($options['atomic']) && $options['atomic']) { $class = Atomic::class; @@ -525,7 +525,7 @@ class Client implements ClientInterface, IteratorAggregate * * @return MultiExecTransaction|array */ - protected function createTransaction(array $options = null, $callable = null) + protected function createTransaction(?array $options = null, $callable = null) { $transaction = new MultiExecTransaction($this, $options); @@ -557,7 +557,7 @@ class Client implements ClientInterface, IteratorAggregate * * @return PubSubConsumer|null */ - protected function createPubSub(array $options = null, $callable = null) + protected function createPubSub(?array $options = null, $callable = null) { if ($this->connection instanceof RelayConnection) { $pubsub = new RelayPubSubConsumer($this, $options); diff --git a/plugins/cache-redis/Predis/PubSub/Consumer.php b/plugins/cache-redis/Predis/PubSub/Consumer.php index b52673232..51ac3cd78 100644 --- a/plugins/cache-redis/Predis/PubSub/Consumer.php +++ b/plugins/cache-redis/Predis/PubSub/Consumer.php @@ -30,7 +30,7 @@ class Consumer extends AbstractConsumer * @param ClientInterface $client Client instance used by the consumer. * @param array $options Options for the consumer initialization. */ - public function __construct(ClientInterface $client, array $options = null) + public function __construct(ClientInterface $client, ?array $options = null) { $this->checkCapabilities($client); diff --git a/plugins/cache-redis/Predis/Transaction/MultiExec.php b/plugins/cache-redis/Predis/Transaction/MultiExec.php index 32ac1e123..e7cf26944 100644 --- a/plugins/cache-redis/Predis/Transaction/MultiExec.php +++ b/plugins/cache-redis/Predis/Transaction/MultiExec.php @@ -51,7 +51,7 @@ class MultiExec implements ClientContextInterface * @param ClientInterface $client Client instance used by the transaction. * @param array $options Initialization options. */ - public function __construct(ClientInterface $client, array $options = null) + public function __construct(ClientInterface $client, ?array $options = null) { $this->assertClient($client); diff --git a/plugins/login-oauth2/OAuth2/Client.php b/plugins/login-oauth2/OAuth2/Client.php index 46f34c42f..176240d5b 100644 --- a/plugins/login-oauth2/OAuth2/Client.php +++ b/plugins/login-oauth2/OAuth2/Client.php @@ -401,7 +401,7 @@ class Client * @param int $form_content_type HTTP form content type to use * @return array */ - private function executeRequest($url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = null, $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) + private function executeRequest($url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, ?array $http_headers = null, $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) { $curl_options = array( CURLOPT_RETURNTRANSFER => true, diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Base/Collection.php b/snappymail/v/0.0.0/app/libraries/MailSo/Base/Collection.php index 634c5a3c7..e8aaec0ad 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Base/Collection.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Base/Collection.php @@ -64,14 +64,14 @@ abstract class Collection extends \ArrayObject implements \JsonSerializable return $callable($this->getArrayCopy(), ...$arguments); } */ - public function Slice(int $offset, int $length = null, bool $preserve_keys = false) + public function Slice(int $offset, ?int $length = null, bool $preserve_keys = false) { return new static( \array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys) ); } - public function Crop(int $length = null, int $offset = 0, bool $preserve_keys = false) + public function Crop(?int $length = null, int $offset = 0, bool $preserve_keys = false) { $this->exchangeArray( \array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys) diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/Binary.php b/snappymail/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/Binary.php index a1101f594..7302e953a 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/Binary.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/Binary.php @@ -109,7 +109,7 @@ class Binary * @return resource|bool */ public static function CreateStream($rStream, - string $sUtilsDecodeOrEncodeFunctionName = null, string $sFromEncoding = null, string $sToEncoding = null) + ?string $sUtilsDecodeOrEncodeFunctionName = null, ?string $sFromEncoding = null, ?string $sToEncoding = null) { if (null === $sUtilsDecodeOrEncodeFunctionName || !\strlen($sUtilsDecodeOrEncodeFunctionName)) { $sUtilsDecodeOrEncodeFunctionName = 'InlineNullDecode'; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php index c8403b0ff..7210e6add 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php @@ -285,7 +285,7 @@ trait Folders * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - public function FolderExpunge(SequenceSet $oUidRange = null) : void + public function FolderExpunge(?SequenceSet $oUidRange = null) : void { $sCmd = 'EXPUNGE'; $aArguments = array(); diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Messages.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Messages.php index 07684ee5d..10003e83a 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Messages.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Messages.php @@ -163,7 +163,7 @@ trait Messages * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - public function MessageAppendStream(string $sFolderName, $rMessageStream, int $iStreamSize, array $aFlagsList = null, int $iDateTime = 0) : ?int + public function MessageAppendStream(string $sFolderName, $rMessageStream, int $iStreamSize, ?array $aFlagsList = null, int $iDateTime = 0) : ?int { if (!\is_resource($rMessageStream)) { throw new \InvalidArgumentException('$rMessageStream must be a resource'); @@ -225,7 +225,7 @@ trait Messages /** * RFC 3502 MULTIAPPEND - public function MessageAppendStreams(string $sFolderName, $rMessageAppendStream, int $iStreamSize, array $aFlagsList = null, int &$iUid = null, int $iDateTime = 0) : ?int + public function MessageAppendStreams(string $sFolderName, $rMessageAppendStream, int $iStreamSize, ?array $aFlagsList = null, ?int &$iUid = null, int $iDateTime = 0) : ?int */ /** @@ -311,7 +311,7 @@ trait Messages * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - public function MessageReplaceStream(string $sFolderName, int $iUid, $rMessageStream, int $iStreamSize, array $aFlagsList = null, int $iDateTime = 0) : ?int + public function MessageReplaceStream(string $sFolderName, int $iUid, $rMessageStream, int $iStreamSize, ?array $aFlagsList = null, int $iDateTime = 0) : ?int { if (1 > $iUid || !$this->hasCapability('REPLACE')) { $this->FolderSelect($sFolderName); @@ -412,7 +412,7 @@ trait Messages * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - public function MessageESearch(string $sSearchCriterias, array $aSearchReturn = null, bool $bReturnUid = true, string $sLimit = '') : array + public function MessageESearch(string $sSearchCriterias, ?array $aSearchReturn = null, bool $bReturnUid = true, string $sLimit = '') : array { $oESearch = new \MailSo\Imap\Requests\ESEARCH($this); $oESearch->sCriterias = $sSearchCriterias ?: 'ALL'; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Folder.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Folder.php index 4a9b2dd21..276eeb13f 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Folder.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/Folder.php @@ -36,7 +36,7 @@ class Folder implements \JsonSerializable /** * @throws \ValueError */ - function __construct(string $sFullName, string $sDelimiter = null, array $aAttributes = array()) + function __construct(string $sFullName, ?string $sDelimiter = null, array $aAttributes = array()) { if (!\strlen($sFullName)) { throw new \ValueError; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php index 7ed53df14..ace504b1c 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php @@ -466,7 +466,7 @@ class ImapClient extends \MailSo\Net\NetClient * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - protected function streamResponse(string $sEndTag = null) : void + protected function streamResponse(?string $sEndTag = null) : void { try { if (\is_resource($this->ConnectionResource())) { @@ -488,7 +488,7 @@ class ImapClient extends \MailSo\Net\NetClient } } - protected function getResponse(string $sEndTag = null) : ResponseCollection + protected function getResponse(?string $sEndTag = null) : ResponseCollection { try { $oResult = new ResponseCollection; diff --git a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php index 2b1d5b1a1..f12675d8d 100644 --- a/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php +++ b/snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php @@ -279,7 +279,7 @@ class MailClient return ($aFetchResponse && 1 === \count($aFetchResponse)); } - public function MessageAppendFile(string $sMessageFileName, string $sFolderToSave, array $aAppendFlags = null) : int + public function MessageAppendFile(string $sMessageFileName, string $sFolderToSave, ?array $aAppendFlags = null) : int { if (!\is_file($sMessageFileName) || !\is_readable($sMessageFileName)) { throw new \ValueError; @@ -349,7 +349,7 @@ class MailClient * @throws \MailSo\Net\Exceptions\* * @throws \MailSo\Imap\Exceptions\* */ - public function FolderInformation(string $sFolderName, int $iPrevUidNext = 0, SequenceSet $oRange = null) : array + public function FolderInformation(string $sFolderName, int $iPrevUidNext = 0, ?SequenceSet $oRange = null) : array { if ($oRange) { // $aInfo = $this->oImapClient->FolderExamine($sFolderName)->jsonSerialize(); diff --git a/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php b/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php index c09fa5a4d..5d001130c 100644 --- a/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php +++ b/snappymail/v/0.0.0/app/libraries/OAuth2/Client.php @@ -401,7 +401,7 @@ class Client * @param int $form_content_type HTTP form content type to use * @return array */ - private function executeRequest($url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = null, $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) + private function executeRequest($url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, ?array $http_headers = null, $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) { $curl_options = array( CURLOPT_RETURNTRANSFER => true, diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php index 4074a3d3b..f61af74db 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php @@ -439,7 +439,7 @@ trait UserAuth /** * @throws \RainLoop\Exceptions\ClientException */ - protected function imapConnect(Account $oAccount, bool $bAuthLog = false, \MailSo\Imap\ImapClient $oImapClient = null): void + protected function imapConnect(Account $oAccount, bool $bAuthLog = false, ?\MailSo\Imap\ImapClient $oImapClient = null): void { try { if (!$oImapClient) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php index 69c5264ff..f73d0017e 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Api.php @@ -35,7 +35,7 @@ abstract class Api return $oConfig; } - public static function getCSP(string $sScriptNonce = null) : \SnappyMail\HTTP\CSP + public static function getCSP(?string $sScriptNonce = null) : \SnappyMail\HTTP\CSP { $oConfig = static::Config(); $CSP = new \SnappyMail\HTTP\CSP(\trim($oConfig->Get('security', 'content_security_policy', ''))); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Domain.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Domain.php index 6e2377238..66072a4bb 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Domain.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Domain.php @@ -55,7 +55,7 @@ class Domain extends AbstractProvider return $this->oDriver->GetList($bIncludeAliases); } - public function LoadOrCreateNewFromAction(\RainLoop\Actions $oActions, string $sNameForTest = null) : ?\RainLoop\Model\Domain + public function LoadOrCreateNewFromAction(\RainLoop\Actions $oActions, ?string $sNameForTest = null) : ?\RainLoop\Model\Domain { $sName = \mb_strtolower((string) $oActions->GetActionParam('name', '')); if (\strlen($sName) && $sNameForTest && !\str_contains($sName, '*')) { diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php index e46e2541c..52104cf80 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php @@ -251,7 +251,7 @@ abstract class Service return true; } - private static function setCSP(string $sScriptNonce = null) : void + private static function setCSP(?string $sScriptNonce = null) : void { Api::getCSP($sScriptNonce)->setHeaders(); } diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php b/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php index 4c7706498..77ea6f29a 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/crypt.php @@ -60,7 +60,7 @@ abstract class Crypt public static function Decrypt(array $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : mixed */ { if (3 === \count($data) && isset($data[0], $data[1], $data[2]) && \strlen($data[0])) { @@ -85,7 +85,7 @@ abstract class Crypt public static function DecryptFromJSON(string $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : mixed */ { $data = static::jsonDecode($data); @@ -98,7 +98,7 @@ abstract class Crypt public static function DecryptUrlSafe(string $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : mixed */ { $data = \explode('.', $data); @@ -113,7 +113,7 @@ abstract class Crypt #[\SensitiveParameter] $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : array { $data = \json_encode($data); @@ -151,7 +151,7 @@ abstract class Crypt #[\SensitiveParameter] $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : string { return \json_encode(\array_map('base64_encode', static::Encrypt($data, $key))); @@ -161,7 +161,7 @@ abstract class Crypt #[\SensitiveParameter] $data, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : string { return \implode('.', \array_map('MailSo\\Base\\Utils::UrlSafeBase64Encode', static::Encrypt($data, $key))); @@ -169,7 +169,7 @@ abstract class Crypt public static function SodiumDecrypt(string $data, string $nonce, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : string|false */ { if (!\is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) { @@ -188,7 +188,7 @@ abstract class Crypt string $data, string $nonce, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : string { if (!\is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) { @@ -208,7 +208,7 @@ abstract class Crypt public static function OpenSSLDecrypt(string $data, string $iv, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : string|false */ { if (!$data || !$iv) { @@ -235,7 +235,7 @@ abstract class Crypt string $data, string $iv, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : string { if (!$data || !$iv) { @@ -263,7 +263,7 @@ abstract class Crypt public static function XxteaDecrypt(string $data, string $salt, #[\SensitiveParameter] - string $key = null + ?string $key = null ) /* : mixed */ { if (!$data || !$salt) { @@ -280,7 +280,7 @@ abstract class Crypt string $data, string $salt, #[\SensitiveParameter] - string $key = null + ?string $key = null ) : string { if (!$data || !$salt) { diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php b/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php index 98eaa4c8b..8bc717c15 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php @@ -63,7 +63,7 @@ class Client * * If the specified url is relative, it will be expanded based on the base url. */ - public function request(string $method, string $url = '', string $body = null, array $headers = array()) : \SnappyMail\HTTP\Response + public function request(string $method, string $url = '', ?string $body = null, array $headers = array()) : \SnappyMail\HTTP\Response { if (!\preg_match('@^(https?:)?//@', $url)) { // If the url starts with a slash, we must calculate the url based off diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/http/exception.php b/snappymail/v/0.0.0/app/libraries/snappymail/http/exception.php index 9778e2028..ceed8b772 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/http/exception.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/http/exception.php @@ -66,7 +66,7 @@ class Exception extends \Exception 511 => 'Network Authentication Required', ); - function __construct(string $message = "", int $code = 0, Response $response = null) + function __construct(string $message = "", int $code = 0, ?Response $response = null) { if ($response) { if (\in_array($code, array(301, 302, 303, 307))) { diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/http/response.php b/snappymail/v/0.0.0/app/libraries/snappymail/http/response.php index 126af9564..d52624415 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/http/response.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/http/response.php @@ -12,7 +12,7 @@ class Response $headers = array(), # The headers returned from the final_uri $body; # The body returned from the final_uri - function __construct(string $request_uri, int $status = 0, array $headers = null, $body = null) + function __construct(string $request_uri, int $status = 0, ?array $headers = null, $body = null) { if ($headers) { $name = null; diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/image/exif.php b/snappymail/v/0.0.0/app/libraries/snappymail/image/exif.php index dc08aabd3..d587ba4ff 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/image/exif.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/image/exif.php @@ -16,7 +16,7 @@ class Exif ORIENTATION_RIGHTBOTTOM = 7, ORIENTATION_LEFTBOTTOM = 8; */ - public static function getImageOrientation(string &$data, array $image_info = null) : int + public static function getImageOrientation(string &$data, ?array $image_info = null) : int { $image_info = empty($image_info['mime']) ? \getimagesizefromstring($data) : $image_info; if (!empty($image_info['mime']) && \IMG_JPG == $image_info[2] && \is_callable('exif_read_data')) { diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/jwt.php b/snappymail/v/0.0.0/app/libraries/snappymail/jwt.php index 3983709dc..e919455d2 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/jwt.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/jwt.php @@ -26,7 +26,7 @@ abstract class JWT * @param int $timestamp Allow the current timestamp to be specified. default time() * @param int $leeway When checking nbf (Not Before) Claim, iat (Issued At) Claim or expiration times, we want to provide some extra leeway time to account for clock skew. */ - public static function decode(string $jwt, $key, int $timestamp = null, int $leeway = 0) : object + public static function decode(string $jwt, $key, ?int $timestamp = null, int $leeway = 0) : object { $timestamp = $timestamp ?: \time(); diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php b/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php index 7e59e6c95..53509561b 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php @@ -81,7 +81,7 @@ class TAR } } - public function addFile($fileinfo, string $name = null) : bool + public function addFile($fileinfo, ?string $name = null) : bool { if (!($fileinfo instanceof \SplFileInfo)) { $fileinfo = new \SplFileInfo($fileinfo); @@ -174,7 +174,7 @@ class TAR return true; } - public function addDir(string $dirname, \SplFileInfo $fileinfo = null) : void + public function addDir(string $dirname, ?\SplFileInfo $fileinfo = null) : void { $this->writeEntryHeader( \rtrim(\strtr($dirname, '\\', '/'), '/') . '/', diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/stream/zip.php b/snappymail/v/0.0.0/app/libraries/snappymail/stream/zip.php index 77ac66381..135e4fdbc 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/stream/zip.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/stream/zip.php @@ -102,7 +102,7 @@ class ZIP } } - public function addFile($file, string $name = null) : bool + public function addFile($file, ?string $name = null) : bool { if (\is_file($file) && $fp = new \SplFileObject($file, 'rb')) { return $this->addFromStream($fp, $name ?: \basename($file));