Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/clicommands/MigrateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,18 @@

if (Str::startsWith(ltrim($dashboardUrlString, '/'), 'icingadb/')) {
$finalUrl = $dashBoardUrl->onlyWith(['sort', 'limit', 'view', 'columns', 'page']);
$params = $dashBoardUrl->without(['sort', 'limit', 'view', 'columns', 'page'])->getParams();

Check failure on line 511 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method getParams() on mixed.

Check failure on line 511 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method getParams() on mixed.

Check failure on line 511 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method getParams() on mixed.
$filter = QueryString::parse($params->toString());

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method toString() on mixed.
$filter = UrlMigrator::transformLegacyWildcardFilter($filter);
if ($filter) {
$oldFilterString = $params->toString();

Check failure on line 515 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 515 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 515 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method toString() on mixed.
$newFilterString = QueryString::render($filter);

if ($oldFilterString !== $newFilterString) {
Logger::info(
'Icinga Db Web filter of dashboard "%s" has changed from "%s" to "%s"',
$name,
$params->toString(),

Check failure on line 522 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 522 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 522 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method toString() on mixed.
QueryString::render($filter)
);
$finalUrl->setFilter($filter);
Expand Down Expand Up @@ -631,11 +631,11 @@
if ($url && Str::startsWith(ltrim($url, '/'), 'icingadb/')) {
$url = Url::fromPath($url, [], new Request());
$finalUrl = $url->onlyWith(['sort', 'limit', 'view', 'columns', 'page']);
$params = $url->without(['sort', 'limit', 'view', 'columns', 'page'])->getParams();

Check failure on line 634 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method getParams() on mixed.

Check failure on line 634 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method getParams() on mixed.

Check failure on line 634 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method getParams() on mixed.
$filter = QueryString::parse($params->toString());

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $string of static method ipl\Web\Filter\QueryString::parse() expects string, mixed given.

Check failure on line 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method toString() on mixed.
$filter = UrlMigrator::transformLegacyWildcardFilter($filter);
if ($filter) {
$oldFilterString = $params->toString();

Check failure on line 638 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 638 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Cannot call method toString() on mixed.

Check failure on line 638 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot call method toString() on mixed.
$newFilterString = QueryString::render($filter);

if ($oldFilterString !== $newFilterString) {
Expand Down Expand Up @@ -783,10 +783,10 @@
$rc = 128;
}

return $config;

Check failure on line 786 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Method Icinga\Module\Icingadb\Clicommands\MigrateCommand::readFromIni() should return Icinga\Application\Config but returns mixed.

Check failure on line 786 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.4 on ubuntu-latest

Method Icinga\Module\Icingadb\Clicommands\MigrateCommand::readFromIni() should return Icinga\Application\Config but returns mixed.

Check failure on line 786 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Method Icinga\Module\Icingadb\Clicommands\MigrateCommand::readFromIni() should return Icinga\Application\Config but returns mixed.
}

private function createBackupIni(string $path, Config $config = null): void
private function createBackupIni(string $path, ?Config $config = null): void
{
$counter = 0;
while (true) {
Expand Down
8 changes: 4 additions & 4 deletions application/forms/RedisConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -675,13 +675,13 @@ public static function checkRedis(Form $form): bool
* Wraps the given IPL validator class into a callback validator
* for usage as the only validator of the element given by name.
*
* @param string $cls IPL validator class FQN
* @param string $element Form element name
* @param Closure $additionalValidator
* @param string $cls IPL validator class FQN
* @param string $element Form element name
* @param ?Closure $additionalValidator
*
* @return array Callback validator
*/
private function wrapIplValidator(string $cls, string $element, Closure $additionalValidator = null): array
private function wrapIplValidator(string $cls, string $element, ?Closure $additionalValidator = null): array
{
return [
'Callback',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getOutput()
*
* @return $this
*/
public function setPerformanceData(string $performanceData = null): self
public function setPerformanceData(?string $performanceData = null): self
{
$this->performanceData = $performanceData;

Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Command/Transport/ApiCommandTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ protected function sendCommand(IcingaApiCommand $command)
*
* @return mixed
*/
public function send(IcingaCommand|IcingaApiCommand $command, int $now = null)
public function send(IcingaCommand|IcingaApiCommand $command, ?int $now = null)
{
if ($command instanceof IcingaCommand) {
$command = $this->renderer->render($command);
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Command/Transport/CommandTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static function createTransport(ConfigObject $config): ApiCommandTranspor
*
* @return mixed
*/
public function send(IcingaCommand $command, int $now = null)
public function send(IcingaCommand $command, ?int $now = null)
{
$errors = [];
$results = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ interface CommandTransportInterface
*
* @throws CommandTransportException If sending the Icinga command failed
*/
public function send(IcingaCommand $command, int $now = null);
public function send(IcingaCommand $command, ?int $now = null);
}
11 changes: 10 additions & 1 deletion library/Icingadb/Common/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,16 @@ public static function getDb(): Connection

$config->options = [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ];
if ($config->db === 'mysql') {
$config->options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES"
// In PHP 8.5+, driver-specific constants of the PDO class are deprecated,
// but the replacements are only available since php 8.4
if (version_compare(PHP_VERSION, '8.4.0', '<')) {
$mysqlAttrInitCommand = PDO::MYSQL_ATTR_INIT_COMMAND;
} else {
$mysqlAttrInitCommand = Pdo\Mysql::ATTR_INIT_COMMAND;
}

$config->options[$mysqlAttrInitCommand]
= "SET SESSION SQL_MODE='STRICT_TRANS_TABLES"
. ",NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
}

Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Common/HostStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function int(string $state): int
*
* @throws \InvalidArgumentException If the given host state is invalid, i.e. not known
*/
public static function text(int $state = null): string
public static function text(?int $state = null): string
{
switch (true) {
case $state === self::UP:
Expand Down Expand Up @@ -83,7 +83,7 @@ public static function text(int $state = null): string
*
* @throws \InvalidArgumentException If the given host state is invalid, i.e. not known
*/
public static function translated(int $state = null): string
public static function translated(?int $state = null): string
{
switch (true) {
case $state === self::UP:
Expand Down
6 changes: 3 additions & 3 deletions library/Icingadb/Common/IcingaRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function fetchState(string $key, array $ids, array $columns): Generato
*
* @return float|int|null
*/
public static function getLastIcingaHeartbeat(Redis $redis = null)
public static function getLastIcingaHeartbeat(?Redis $redis = null)
{
if ($redis === null) {
$redis = Backend::getRedis()->getConnection();
Expand Down Expand Up @@ -205,7 +205,7 @@ public static function getLastIcingaHeartbeat(Redis $redis = null)
*
* @return Redis
*/
public static function getPrimaryRedis(Config $moduleConfig = null, Config $redisConfig = null): Redis
public static function getPrimaryRedis(?Config $moduleConfig = null, ?Config $redisConfig = null): Redis
{
if ($moduleConfig === null) {
$moduleConfig = Config::module('icingadb');
Expand Down Expand Up @@ -239,7 +239,7 @@ public static function getPrimaryRedis(Config $moduleConfig = null, Config $redi
*
* @return ?Redis
*/
public static function getSecondaryRedis(Config $moduleConfig = null, Config $redisConfig = null)
public static function getSecondaryRedis(?Config $moduleConfig = null, ?Config $redisConfig = null)
{
if ($moduleConfig === null) {
$moduleConfig = Config::module('icingadb');
Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Common/ServiceStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static function int(string $state): int
*
* @throws \InvalidArgumentException If the given service state is invalid, i.e. not known
*/
public static function text(int $state = null): string
public static function text(?int $state = null): string
{
switch (true) {
case $state === self::OK:
Expand Down Expand Up @@ -99,7 +99,7 @@ public static function text(int $state = null): string
*
* @throws \InvalidArgumentException If the given service state is invalid, i.e. not known
*/
public static function translated(int $state = null): string
public static function translated(?int $state = null): string
{
switch (true) {
case $state === self::OK:
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Common/StateBadges.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function setUrl(Url $url): self
*
* @return Link
*/
protected function createLink($content, Filter\Rule $filter = null): Link
protected function createLink($content, ?Filter\Rule $filter = null): Link
{
$url = clone $this->getUrl();

Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Compat/UrlMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static function transformUrl(Url $url): Url
return $url;
}

public static function transformParams(Url $url, string $transformerName = null): array
public static function transformParams(Url $url, ?string $transformerName = null): array
{
$transformer = new self();

Expand Down Expand Up @@ -156,7 +156,7 @@ public static function transformParams(Url $url, string $transformerName = null)
*
* @return Filter\Rule|false
*/
public static function transformFilter(Filter\Rule $filter, string $queryTransformer = null)
public static function transformFilter(Filter\Rule $filter, ?string $queryTransformer = null)
{
$transformer = new self();

Expand Down
24 changes: 12 additions & 12 deletions library/Icingadb/Data/PivotTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ public function __construct(Query $query, string $xAxisColumn, string $yAxisColu
/**
* Set the filter to apply on the query for the x-axis
*
* @param Filter\Rule $filter
* @param ?Filter\Rule $filter
*
* @return $this
*/
public function setXAxisFilter(Filter\Rule $filter = null): self
public function setXAxisFilter(?Filter\Rule $filter = null): self
{
$this->xAxisFilter = $filter;
return $this;
Expand All @@ -127,11 +127,11 @@ public function setXAxisFilter(Filter\Rule $filter = null): self
/**
* Set the filter to apply on the query for the y-axis
*
* @param Filter\Rule $filter
* @param ?Filter\Rule $filter
*
* @return $this
*/
public function setYAxisFilter(Filter\Rule $filter = null): self
public function setYAxisFilter(?Filter\Rule $filter = null): self
{
$this->yAxisFilter = $filter;
return $this;
Expand Down Expand Up @@ -204,11 +204,11 @@ public function setYAxisHeader(string $yAxisHeader): self
*
* @param string $axis The axis for which to return the parameter ('x' or 'y')
* @param string $param The parameter name to return
* @param int $default The default value to return
* @param ?int $default The default value to return
*
* @return int
*/
protected function getPaginationParameter(string $axis, string $param, int $default = null): int
protected function getPaginationParameter(string $axis, string $param, ?int $default = null): int
{
/** @var Web $app */
$app = Icinga::app();
Expand Down Expand Up @@ -325,12 +325,12 @@ protected function queryYAxis(): Query
*
* $limit and $page are taken from the current request if not given.
*
* @param int $limit The maximum amount of entries to fetch
* @param int $page The page to set as current one
* @param ?int $limit The maximum amount of entries to fetch
* @param ?int $page The page to set as current one
*
* @return Paginatable
*/
public function paginateXAxis(int $limit = null, int $page = null): Paginatable
public function paginateXAxis(?int $limit = null, ?int $page = null): Paginatable
{
if ($limit === null || $page === null) {
if ($limit === null) {
Expand All @@ -357,12 +357,12 @@ public function paginateXAxis(int $limit = null, int $page = null): Paginatable
*
* $limit and $page are taken from the current request if not given.
*
* @param int $limit The maximum amount of entries to fetch
* @param int $page The page to set as current one
* @param ?int $limit The maximum amount of entries to fetch
* @param ?int $page The page to set as current one
*
* @return Paginatable
*/
public function paginateYAxis(int $limit = null, int $page = null): Paginatable
public function paginateYAxis(?int $limit = null, ?int $page = null): Paginatable
{
if ($limit === null || $page === null) {
if ($limit === null) {
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Hook/Common/TotalSlaReportUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

trait TotalSlaReportUtils
{
public function getHtml(Timerange $timerange, array $config = null)
public function getHtml(Timerange $timerange, ?array $config = null)
{
$data = $this->getData($timerange, $config);
$count = $data->count();
Expand Down
3 changes: 1 addition & 2 deletions library/Icingadb/Model/UnreachableParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function createBehaviors(Behaviors $behaviors): void
]));
}

public static function on(Connection $db, Model $root = null): Query
public static function on(Connection $db, ?Model $root = null): Query
{
if ($root === null) {
throw new InvalidArgumentException('Root node must not be null');
Expand Down Expand Up @@ -187,7 +187,6 @@ private static function selectNodes(Connection $db, Model $root): Select

// TODO: ipl-orm doesn't preserve key order :'(
$columnsProperty = (new \ReflectionClass($nodeSelect))->getProperty('columns');
$columnsProperty->setAccessible(true);
$columnsProperty->setValue($nodeSelect, array_merge(
[
'id' => null,
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/ProvidedHook/Reporting/HostSlaReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function createReportRow($row)
->setValues([(float) $row->sla]);
}

protected function fetchSla(Timerange $timerange, Rule $filter = null)
protected function fetchSla(Timerange $timerange, ?Rule $filter = null)
{
$sla = Host::on($this->getDb())
->columns([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function createReportRow($row)
->setValues([(float) $row->sla]);
}

protected function fetchSla(Timerange $timerange, Rule $filter = null)
protected function fetchSla(Timerange $timerange, ?Rule $filter = null)
{
$sla = Service::on($this->getDb())
->columns([
Expand Down
8 changes: 4 additions & 4 deletions library/Icingadb/ProvidedHook/Reporting/SlaReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ abstract protected function createReportRow($row);
*
* @return iterable
*/
abstract protected function fetchSla(Timerange $timerange, Rule $filter = null);
abstract protected function fetchSla(Timerange $timerange, ?Rule $filter = null);

protected function fetchReportData(Timerange $timerange, array $config = null)
protected function fetchReportData(Timerange $timerange, ?array $config = null)
{
$rd = $this->createReportData();
$rows = [];
Expand Down Expand Up @@ -208,12 +208,12 @@ public function initConfigForm(Form $form)
]);
}

public function getData(Timerange $timerange, array $config = null)
public function getData(Timerange $timerange, ?array $config = null)
{
return $this->fetchReportData($timerange, $config);
}

public function getHtml(Timerange $timerange, array $config = null)
public function getHtml(Timerange $timerange, ?array $config = null)
{
$data = $this->getData($timerange, $config);

Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/ProvidedHook/X509/Sni.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Sni extends SniHook
/**
* @inheritDoc
*/
public function getHosts(Filter $filter = null): Generator
public function getHosts(?Filter $filter = null): Generator
{
$this->getDb()->ping();

Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Util/PerfDataSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@ protected function readLabel(): string
* Return all characters between the current parser position and the given character
*
* @param string $stopChar The character on which to stop
* @param string $backtrackOn The character on which to backtrack
* @param ?string $backtrackOn The character on which to backtrack
*
* @return string
*/
protected function readUntil(string $stopChar, string $backtrackOn = null): string
protected function readUntil(string $stopChar, ?string $backtrackOn = null): string
{
$start = $this->parserPos;
$breakCharEncounteredAt = null;
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Web/Control/ViewModeSwitcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getViewMode(): string
{
$viewMode = $this->getPopulatedValue($this->getViewModeParam(), $this->getDefaultViewMode());

if (array_key_exists($viewMode, static::$viewModes)) {
if ($viewMode && array_key_exists($viewMode, static::$viewModes)) {
return $viewMode;
}

Expand Down
6 changes: 3 additions & 3 deletions library/Icingadb/Web/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,11 @@ protected function prepareSearchFilter(Query $query, string $search, Filter\Any
/**
* Require permission to access the given route
*
* @param string $name If NULL, the current controller name is used
* @param ?string $name If NULL, the current controller name is used
*
* @throws SecurityException
*/
public function assertRouteAccess(string $name = null)
public function assertRouteAccess(?string $name = null)
{
if (! $name) {
$name = $this->getRequest()->getControllerName();
Expand Down Expand Up @@ -447,7 +447,7 @@ protected function addContent(ValidHtml $content)
return parent::addContent($content);
}

public function filter(Query $query, Filter\Rule $filter = null): self
public function filter(Query $query, ?Filter\Rule $filter = null): self
{
if ($this->format !== 'sql' || $this->hasPermission('config/authentication/roles/show')) {
$this->applyRestrictions($query);
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Web/Navigation/Renderer/ProblemsBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getTitle()
return $this->title;
}

public function render(NavigationItem $item = null): string
public function render(?NavigationItem $item = null): string
{
if ($item === null) {
$item = $this->getItem();
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Widget/Detail/CustomVarTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CustomVarTable extends BaseHtmlElement
* @param iterable $data
* @param ?Model $object
*/
public function __construct($data, Model $object = null)
public function __construct($data, ?Model $object = null)
{
$this->data = $data;
$this->object = $object;
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Widget/ShowMore.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ShowMore extends BaseHtmlElement
/** @var ?string */
protected $label;

public function __construct(ResultSet $resultSet, Url $url, string $label = null)
public function __construct(ResultSet $resultSet, Url $url, ?string $label = null)
{
$this->label = $label;
$this->resultSet = $resultSet;
Expand Down
Loading