Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 4e3a7a6

Browse files
author
the-djmaze
committed
PHP 8.4: Implicitly nullable parameter declarations deprecated
1 parent 0263f8f commit 4e3a7a6

File tree

24 files changed

+44
-44
lines changed

24 files changed

+44
-44
lines changed

plugins/cache-redis/Predis/Client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ public function pipeline(...$arguments)
472472
*
473473
* @return Pipeline|array
474474
*/
475-
protected function createPipeline(array $options = null, $callable = null)
475+
protected function createPipeline(?array $options = null, $callable = null)
476476
{
477477
if (isset($options['atomic']) && $options['atomic']) {
478478
$class = Atomic::class;
@@ -525,7 +525,7 @@ public function transaction(...$arguments)
525525
*
526526
* @return MultiExecTransaction|array
527527
*/
528-
protected function createTransaction(array $options = null, $callable = null)
528+
protected function createTransaction(?array $options = null, $callable = null)
529529
{
530530
$transaction = new MultiExecTransaction($this, $options);
531531

@@ -557,7 +557,7 @@ public function pubSubLoop(...$arguments)
557557
*
558558
* @return PubSubConsumer|null
559559
*/
560-
protected function createPubSub(array $options = null, $callable = null)
560+
protected function createPubSub(?array $options = null, $callable = null)
561561
{
562562
if ($this->connection instanceof RelayConnection) {
563563
$pubsub = new RelayPubSubConsumer($this, $options);

plugins/cache-redis/Predis/PubSub/Consumer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Consumer extends AbstractConsumer
3030
* @param ClientInterface $client Client instance used by the consumer.
3131
* @param array $options Options for the consumer initialization.
3232
*/
33-
public function __construct(ClientInterface $client, array $options = null)
33+
public function __construct(ClientInterface $client, ?array $options = null)
3434
{
3535
$this->checkCapabilities($client);
3636

plugins/cache-redis/Predis/Transaction/MultiExec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class MultiExec implements ClientContextInterface
5151
* @param ClientInterface $client Client instance used by the transaction.
5252
* @param array $options Initialization options.
5353
*/
54-
public function __construct(ClientInterface $client, array $options = null)
54+
public function __construct(ClientInterface $client, ?array $options = null)
5555
{
5656
$this->assertClient($client);
5757

plugins/login-oauth2/OAuth2/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private function generateMACSignature($url, $parameters, $http_method)
401401
* @param int $form_content_type HTTP form content type to use
402402
* @return array
403403
*/
404-
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)
404+
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)
405405
{
406406
$curl_options = array(
407407
CURLOPT_RETURNTRANSFER => true,

snappymail/v/0.0.0/app/libraries/MailSo/Base/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ public function __call(string $name, array $arguments)
6464
return $callable($this->getArrayCopy(), ...$arguments);
6565
}
6666
*/
67-
public function Slice(int $offset, int $length = null, bool $preserve_keys = false)
67+
public function Slice(int $offset, ?int $length = null, bool $preserve_keys = false)
6868
{
6969
return new static(
7070
\array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys)
7171
);
7272
}
7373

74-
public function Crop(int $length = null, int $offset = 0, bool $preserve_keys = false)
74+
public function Crop(?int $length = null, int $offset = 0, bool $preserve_keys = false)
7575
{
7676
$this->exchangeArray(
7777
\array_slice($this->getArrayCopy(), $offset, $length, $preserve_keys)

snappymail/v/0.0.0/app/libraries/MailSo/Base/StreamWrappers/Binary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function RememberStream($rStream)
109109
* @return resource|bool
110110
*/
111111
public static function CreateStream($rStream,
112-
string $sUtilsDecodeOrEncodeFunctionName = null, string $sFromEncoding = null, string $sToEncoding = null)
112+
?string $sUtilsDecodeOrEncodeFunctionName = null, ?string $sFromEncoding = null, ?string $sToEncoding = null)
113113
{
114114
if (null === $sUtilsDecodeOrEncodeFunctionName || !\strlen($sUtilsDecodeOrEncodeFunctionName)) {
115115
$sUtilsDecodeOrEncodeFunctionName = 'InlineNullDecode';

snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Folders.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public function FolderUnselect() : void
285285
* @throws \MailSo\Net\Exceptions\*
286286
* @throws \MailSo\Imap\Exceptions\*
287287
*/
288-
public function FolderExpunge(SequenceSet $oUidRange = null) : void
288+
public function FolderExpunge(?SequenceSet $oUidRange = null) : void
289289
{
290290
$sCmd = 'EXPUNGE';
291291
$aArguments = array();

snappymail/v/0.0.0/app/libraries/MailSo/Imap/Commands/Messages.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function FetchMessagePart(int $iUid, string $sPartId) : string
163163
* @throws \MailSo\Net\Exceptions\*
164164
* @throws \MailSo\Imap\Exceptions\*
165165
*/
166-
public function MessageAppendStream(string $sFolderName, $rMessageStream, int $iStreamSize, array $aFlagsList = null, int $iDateTime = 0) : ?int
166+
public function MessageAppendStream(string $sFolderName, $rMessageStream, int $iStreamSize, ?array $aFlagsList = null, int $iDateTime = 0) : ?int
167167
{
168168
if (!\is_resource($rMessageStream)) {
169169
throw new \InvalidArgumentException('$rMessageStream must be a resource');
@@ -225,7 +225,7 @@ private function writeMessageStream($rMessageStream) : ?int
225225

226226
/**
227227
* RFC 3502 MULTIAPPEND
228-
public function MessageAppendStreams(string $sFolderName, $rMessageAppendStream, int $iStreamSize, array $aFlagsList = null, int &$iUid = null, int $iDateTime = 0) : ?int
228+
public function MessageAppendStreams(string $sFolderName, $rMessageAppendStream, int $iStreamSize, ?array $aFlagsList = null, ?int &$iUid = null, int $iDateTime = 0) : ?int
229229
*/
230230

231231
/**
@@ -311,7 +311,7 @@ public function MessageDelete(string $sFolder, SequenceSet $oRange, bool $bExpun
311311
* @throws \MailSo\Net\Exceptions\*
312312
* @throws \MailSo\Imap\Exceptions\*
313313
*/
314-
public function MessageReplaceStream(string $sFolderName, int $iUid, $rMessageStream, int $iStreamSize, array $aFlagsList = null, int $iDateTime = 0) : ?int
314+
public function MessageReplaceStream(string $sFolderName, int $iUid, $rMessageStream, int $iStreamSize, ?array $aFlagsList = null, int $iDateTime = 0) : ?int
315315
{
316316
if (1 > $iUid || !$this->hasCapability('REPLACE')) {
317317
$this->FolderSelect($sFolderName);
@@ -412,7 +412,7 @@ public function MessageSort(array $aSortTypes, string $sSearchCriterias, bool $b
412412
* @throws \MailSo\Net\Exceptions\*
413413
* @throws \MailSo\Imap\Exceptions\*
414414
*/
415-
public function MessageESearch(string $sSearchCriterias, array $aSearchReturn = null, bool $bReturnUid = true, string $sLimit = '') : array
415+
public function MessageESearch(string $sSearchCriterias, ?array $aSearchReturn = null, bool $bReturnUid = true, string $sLimit = '') : array
416416
{
417417
$oESearch = new \MailSo\Imap\Requests\ESEARCH($this);
418418
$oESearch->sCriterias = $sSearchCriterias ?: 'ALL';

snappymail/v/0.0.0/app/libraries/MailSo/Imap/Folder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Folder implements \JsonSerializable
3636
/**
3737
* @throws \ValueError
3838
*/
39-
function __construct(string $sFullName, string $sDelimiter = null, array $aAttributes = array())
39+
function __construct(string $sFullName, ?string $sDelimiter = null, array $aAttributes = array())
4040
{
4141
if (!\strlen($sFullName)) {
4242
throw new \ValueError;

snappymail/v/0.0.0/app/libraries/MailSo/Imap/ImapClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ protected function getResponseValue(ResponseCollection $oResponseCollection, int
466466
* @throws \MailSo\Net\Exceptions\*
467467
* @throws \MailSo\Imap\Exceptions\*
468468
*/
469-
protected function streamResponse(string $sEndTag = null) : void
469+
protected function streamResponse(?string $sEndTag = null) : void
470470
{
471471
try {
472472
if (\is_resource($this->ConnectionResource())) {
@@ -488,7 +488,7 @@ protected function streamResponse(string $sEndTag = null) : void
488488
}
489489
}
490490

491-
protected function getResponse(string $sEndTag = null) : ResponseCollection
491+
protected function getResponse(?string $sEndTag = null) : ResponseCollection
492492
{
493493
try {
494494
$oResult = new ResponseCollection;

snappymail/v/0.0.0/app/libraries/MailSo/Mail/MailClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public function MessageMimeStream($mCallback, string $sFolderName, int $iIndex,
279279
return ($aFetchResponse && 1 === \count($aFetchResponse));
280280
}
281281

282-
public function MessageAppendFile(string $sMessageFileName, string $sFolderToSave, array $aAppendFlags = null) : int
282+
public function MessageAppendFile(string $sMessageFileName, string $sFolderToSave, ?array $aAppendFlags = null) : int
283283
{
284284
if (!\is_file($sMessageFileName) || !\is_readable($sMessageFileName)) {
285285
throw new \ValueError;
@@ -349,7 +349,7 @@ private function getFolderNextMessageInformation(string $sFolderName, int $iPrev
349349
* @throws \MailSo\Net\Exceptions\*
350350
* @throws \MailSo\Imap\Exceptions\*
351351
*/
352-
public function FolderInformation(string $sFolderName, int $iPrevUidNext = 0, SequenceSet $oRange = null) : array
352+
public function FolderInformation(string $sFolderName, int $iPrevUidNext = 0, ?SequenceSet $oRange = null) : array
353353
{
354354
if ($oRange) {
355355
// $aInfo = $this->oImapClient->FolderExamine($sFolderName)->jsonSerialize();

snappymail/v/0.0.0/app/libraries/OAuth2/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ private function generateMACSignature($url, $parameters, $http_method)
401401
* @param int $form_content_type HTTP form content type to use
402402
* @return array
403403
*/
404-
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)
404+
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)
405405
{
406406
$curl_options = array(
407407
CURLOPT_RETURNTRANSFER => true,

snappymail/v/0.0.0/app/libraries/RainLoop/Actions/UserAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ public function Logout(bool $bMain) : void
439439
/**
440440
* @throws \RainLoop\Exceptions\ClientException
441441
*/
442-
protected function imapConnect(Account $oAccount, bool $bAuthLog = false, \MailSo\Imap\ImapClient $oImapClient = null): void
442+
protected function imapConnect(Account $oAccount, bool $bAuthLog = false, ?\MailSo\Imap\ImapClient $oImapClient = null): void
443443
{
444444
try {
445445
if (!$oImapClient) {

snappymail/v/0.0.0/app/libraries/RainLoop/Api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function Config() : Config\Application
3535
return $oConfig;
3636
}
3737

38-
public static function getCSP(string $sScriptNonce = null) : \SnappyMail\HTTP\CSP
38+
public static function getCSP(?string $sScriptNonce = null) : \SnappyMail\HTTP\CSP
3939
{
4040
$oConfig = static::Config();
4141
$CSP = new \SnappyMail\HTTP\CSP(\trim($oConfig->Get('security', 'content_security_policy', '')));

snappymail/v/0.0.0/app/libraries/RainLoop/Providers/Domain.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function GetList(bool $bIncludeAliases = true) : array
5555
return $this->oDriver->GetList($bIncludeAliases);
5656
}
5757

58-
public function LoadOrCreateNewFromAction(\RainLoop\Actions $oActions, string $sNameForTest = null) : ?\RainLoop\Model\Domain
58+
public function LoadOrCreateNewFromAction(\RainLoop\Actions $oActions, ?string $sNameForTest = null) : ?\RainLoop\Model\Domain
5959
{
6060
$sName = \mb_strtolower((string) $oActions->GetActionParam('name', ''));
6161
if (\strlen($sName) && $sNameForTest && !\str_contains($sName, '*')) {

snappymail/v/0.0.0/app/libraries/RainLoop/Service.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ private static function RunResult() : bool
251251
return true;
252252
}
253253

254-
private static function setCSP(string $sScriptNonce = null) : void
254+
private static function setCSP(?string $sScriptNonce = null) : void
255255
{
256256
Api::getCSP($sScriptNonce)->setHeaders();
257257
}

snappymail/v/0.0.0/app/libraries/snappymail/crypt.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static function Passphrase(
6060

6161
public static function Decrypt(array $data,
6262
#[\SensitiveParameter]
63-
string $key = null
63+
?string $key = null
6464
) /* : mixed */
6565
{
6666
if (3 === \count($data) && isset($data[0], $data[1], $data[2]) && \strlen($data[0])) {
@@ -85,7 +85,7 @@ public static function Decrypt(array $data,
8585

8686
public static function DecryptFromJSON(string $data,
8787
#[\SensitiveParameter]
88-
string $key = null
88+
?string $key = null
8989
) /* : mixed */
9090
{
9191
$data = static::jsonDecode($data);
@@ -98,7 +98,7 @@ public static function DecryptFromJSON(string $data,
9898

9999
public static function DecryptUrlSafe(string $data,
100100
#[\SensitiveParameter]
101-
string $key = null
101+
?string $key = null
102102
) /* : mixed */
103103
{
104104
$data = \explode('.', $data);
@@ -113,7 +113,7 @@ public static function Encrypt(
113113
#[\SensitiveParameter]
114114
$data,
115115
#[\SensitiveParameter]
116-
string $key = null
116+
?string $key = null
117117
) : array
118118
{
119119
$data = \json_encode($data);
@@ -151,7 +151,7 @@ public static function EncryptToJSON(
151151
#[\SensitiveParameter]
152152
$data,
153153
#[\SensitiveParameter]
154-
string $key = null
154+
?string $key = null
155155
) : string
156156
{
157157
return \json_encode(\array_map('base64_encode', static::Encrypt($data, $key)));
@@ -161,15 +161,15 @@ public static function EncryptUrlSafe(
161161
#[\SensitiveParameter]
162162
$data,
163163
#[\SensitiveParameter]
164-
string $key = null
164+
?string $key = null
165165
) : string
166166
{
167167
return \implode('.', \array_map('MailSo\\Base\\Utils::UrlSafeBase64Encode', static::Encrypt($data, $key)));
168168
}
169169

170170
public static function SodiumDecrypt(string $data, string $nonce,
171171
#[\SensitiveParameter]
172-
string $key = null
172+
?string $key = null
173173
) /* : string|false */
174174
{
175175
if (!\is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) {
@@ -188,7 +188,7 @@ public static function SodiumEncrypt(
188188
string $data,
189189
string $nonce,
190190
#[\SensitiveParameter]
191-
string $key = null
191+
?string $key = null
192192
) : string
193193
{
194194
if (!\is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) {
@@ -208,7 +208,7 @@ public static function SodiumEncrypt(
208208

209209
public static function OpenSSLDecrypt(string $data, string $iv,
210210
#[\SensitiveParameter]
211-
string $key = null
211+
?string $key = null
212212
) /* : string|false */
213213
{
214214
if (!$data || !$iv) {
@@ -235,7 +235,7 @@ public static function OpenSSLEncrypt(
235235
string $data,
236236
string $iv,
237237
#[\SensitiveParameter]
238-
string $key = null
238+
?string $key = null
239239
) : string
240240
{
241241
if (!$data || !$iv) {
@@ -263,7 +263,7 @@ public static function OpenSSLEncrypt(
263263

264264
public static function XxteaDecrypt(string $data, string $salt,
265265
#[\SensitiveParameter]
266-
string $key = null
266+
?string $key = null
267267
) /* : mixed */
268268
{
269269
if (!$data || !$salt) {
@@ -280,7 +280,7 @@ public static function XxteaEncrypt(
280280
string $data,
281281
string $salt,
282282
#[\SensitiveParameter]
283-
string $key = null
283+
?string $key = null
284284
) : string
285285
{
286286
if (!$data || !$salt) {

snappymail/v/0.0.0/app/libraries/snappymail/dav/client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function setVerifyPeer(bool $value) : void
6363
*
6464
* If the specified url is relative, it will be expanded based on the base url.
6565
*/
66-
public function request(string $method, string $url = '', string $body = null, array $headers = array()) : \SnappyMail\HTTP\Response
66+
public function request(string $method, string $url = '', ?string $body = null, array $headers = array()) : \SnappyMail\HTTP\Response
6767
{
6868
if (!\preg_match('@^(https?:)?//@', $url)) {
6969
// If the url starts with a slash, we must calculate the url based off

snappymail/v/0.0.0/app/libraries/snappymail/http/exception.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class Exception extends \Exception
6666
511 => 'Network Authentication Required',
6767
);
6868

69-
function __construct(string $message = "", int $code = 0, Response $response = null)
69+
function __construct(string $message = "", int $code = 0, ?Response $response = null)
7070
{
7171
if ($response) {
7272
if (\in_array($code, array(301, 302, 303, 307))) {

snappymail/v/0.0.0/app/libraries/snappymail/http/response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Response
1212
$headers = array(), # The headers returned from the final_uri
1313
$body; # The body returned from the final_uri
1414

15-
function __construct(string $request_uri, int $status = 0, array $headers = null, $body = null)
15+
function __construct(string $request_uri, int $status = 0, ?array $headers = null, $body = null)
1616
{
1717
if ($headers) {
1818
$name = null;

snappymail/v/0.0.0/app/libraries/snappymail/image/exif.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Exif
1616
ORIENTATION_RIGHTBOTTOM = 7,
1717
ORIENTATION_LEFTBOTTOM = 8;
1818
*/
19-
public static function getImageOrientation(string &$data, array $image_info = null) : int
19+
public static function getImageOrientation(string &$data, ?array $image_info = null) : int
2020
{
2121
$image_info = empty($image_info['mime']) ? \getimagesizefromstring($data) : $image_info;
2222
if (!empty($image_info['mime']) && \IMG_JPG == $image_info[2] && \is_callable('exif_read_data')) {

snappymail/v/0.0.0/app/libraries/snappymail/jwt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static function jsonDecode($data)
2626
* @param int $timestamp Allow the current timestamp to be specified. default time()
2727
* @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.
2828
*/
29-
public static function decode(string $jwt, $key, int $timestamp = null, int $leeway = 0) : object
29+
public static function decode(string $jwt, $key, ?int $timestamp = null, int $leeway = 0) : object
3030
{
3131
$timestamp = $timestamp ?: \time();
3232

snappymail/v/0.0.0/app/libraries/snappymail/stream/tar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function close() : void
8181
}
8282
}
8383

84-
public function addFile($fileinfo, string $name = null) : bool
84+
public function addFile($fileinfo, ?string $name = null) : bool
8585
{
8686
if (!($fileinfo instanceof \SplFileInfo)) {
8787
$fileinfo = new \SplFileInfo($fileinfo);
@@ -174,7 +174,7 @@ public function addFromString(string $name, string $data, int $time = 0) : bool
174174
return true;
175175
}
176176

177-
public function addDir(string $dirname, \SplFileInfo $fileinfo = null) : void
177+
public function addDir(string $dirname, ?\SplFileInfo $fileinfo = null) : void
178178
{
179179
$this->writeEntryHeader(
180180
\rtrim(\strtr($dirname, '\\', '/'), '/') . '/',

snappymail/v/0.0.0/app/libraries/snappymail/stream/zip.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function close() : void
102102
}
103103
}
104104

105-
public function addFile($file, string $name = null) : bool
105+
public function addFile($file, ?string $name = null) : bool
106106
{
107107
if (\is_file($file) && $fp = new \SplFileObject($file, 'rb')) {
108108
return $this->addFromStream($fp, $name ?: \basename($file));

0 commit comments

Comments
 (0)