mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CategoryTree
synced 2024-11-30 11:06:55 +00:00
Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP 8.4. The explicit nullable type must be used instead. Bug: T376276 Change-Id: I40bb7a0a02aaa467cbf0ae182adf5601ccbcb58e
This commit is contained in:
parent
669a25fa43
commit
63688178e9
|
@ -294,7 +294,7 @@ class CategoryTree {
|
||||||
* Returns a string with a HTML represenation of the given page.
|
* Returns a string with a HTML represenation of the given page.
|
||||||
* $info must be an associative array, containing at least a Title object under the 'title' key.
|
* $info must be an associative array, containing at least a Title object under the 'title' key.
|
||||||
*/
|
*/
|
||||||
public function renderNodeInfo( Title $title, Category $cat = null, int $children = 0 ): string {
|
public function renderNodeInfo( Title $title, ?Category $cat = null, int $children = 0 ): string {
|
||||||
$mode = $this->optionManager->getOption( 'mode' );
|
$mode = $this->optionManager->getOption( 'mode' );
|
||||||
|
|
||||||
$isInCatNS = $title->inNamespace( NS_CATEGORY );
|
$isInCatNS = $title->inNamespace( NS_CATEGORY );
|
||||||
|
|
|
@ -190,8 +190,8 @@ class Hooks implements
|
||||||
public function parserHook(
|
public function parserHook(
|
||||||
$cat,
|
$cat,
|
||||||
array $argv,
|
array $argv,
|
||||||
Parser $parser = null,
|
?Parser $parser = null,
|
||||||
PPFrame $frame = null
|
?PPFrame $frame = null
|
||||||
) {
|
) {
|
||||||
if ( $parser ) {
|
if ( $parser ) {
|
||||||
$parserOutput = $parser->getOutput();
|
$parserOutput = $parser->getOutput();
|
||||||
|
|
|
@ -260,7 +260,7 @@ class OptionManager {
|
||||||
* @param int|null $depth
|
* @param int|null $depth
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getOptionsAsCacheKey( int $depth = null ): string {
|
public function getOptionsAsCacheKey( ?int $depth = null ): string {
|
||||||
$key = '';
|
$key = '';
|
||||||
|
|
||||||
foreach ( $this->mOptions as $k => $v ) {
|
foreach ( $this->mOptions as $k => $v ) {
|
||||||
|
@ -280,7 +280,7 @@ class OptionManager {
|
||||||
* @param int|null $depth
|
* @param int|null $depth
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function getOptionsAsJsStructure( int $depth = null ) {
|
public function getOptionsAsJsStructure( ?int $depth = null ) {
|
||||||
$opt = $this->mOptions;
|
$opt = $this->mOptions;
|
||||||
if ( $depth !== null ) {
|
if ( $depth !== null ) {
|
||||||
$opt['depth'] = $depth;
|
$opt['depth'] = $depth;
|
||||||
|
|
Loading…
Reference in a new issue