Skip to content

Commit 02ccd8c

Browse files
HamishSlaterhslater
and
hslater
authored
Use explicit nullable type on parameter arguments (for PHP 8.4) (#259)
Implicitly marking parameter $... as nullable is deprecated in PHP 8.4. The explicit nullable type must be used instead. Co-authored-by: hslater <hamish.slater@hallowelt.com>
1 parent 46823e0 commit 02ccd8c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/AppFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class AppFactory implements LoggerAwareInterface {
5353
* @param array $options
5454
* @param Cache|null $cache
5555
*/
56-
public function __construct( array $options = [], Cache $cache = null ) {
56+
public function __construct( array $options = [], ?Cache $cache = null ) {
5757
$this->options = $options;
5858
$this->cache = $cache;
5959
}
@@ -205,7 +205,7 @@ public function newUserFromID( $id ) {
205205
* @param string $type which log entries to get (default: approval)
206206
* @return DatabaseLogReader
207207
*/
208-
public function newDatabaseLogReader( Title $title = null, $type = 'approval' ) {
208+
public function newDatabaseLogReader( ?Title $title = null, $type = 'approval' ) {
209209
return new DatabaseLogReader( $this->getConnection(), $title, $type );
210210
}
211211
}

src/DatabaseLogReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class DatabaseLogReader {
4848
* @param Title|null $title
4949
* @param string $type of log (default: approval)
5050
*/
51-
public function __construct( $dbr, Title $title = null, $type = 'approval' ) {
51+
public function __construct( $dbr, ?Title $title = null, $type = 'approval' ) {
5252
// Due to MW 1.31+ and MW 1.34+
5353
if (
5454
!$dbr instanceof \Wikimedia\Rdbms\IDatabase &&

src/LabelFetcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class LabelFetcher {
4242
* @param Cache|null $cache
4343
* @param string $languageCode
4444
*/
45-
public function __construct( Cache $cache = null, $languageCode = 'en' ) {
45+
public function __construct( ?Cache $cache = null, $languageCode = 'en' ) {
4646
$this->cache = $cache;
4747
$this->languageCode = $languageCode;
4848

0 commit comments

Comments
 (0)