Skip to content
Merged
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 @@ -509,18 +509,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 512 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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 523 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

Cannot call method toString() on mixed.
QueryString::render($filter)
);
$finalUrl->setFilter($filter);
Expand Down Expand Up @@ -632,11 +632,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 635 in application/clicommands/MigrateCommand.php

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method getParams() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

Cannot call method toString() on mixed.

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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

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

return $config;

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.2) / PHPStan 8.2

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.5) / PHPStan 8.5

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.3) / PHPStan 8.3

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

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

View workflow job for this annotation

GitHub Actions / PHP / Static analysis (8.4) / PHPStan 8.4

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
10 changes: 5 additions & 5 deletions application/forms/RedisConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,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
* @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
6 changes: 3 additions & 3 deletions library/Icingadb/Command/Object/ProcessCheckResultCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ public function getOutput()
/**
* Set the performance data of the host or service check result
*
* @param string|null $performanceData
* @param ?string $performanceData
*
* @return $this
* @return $this
*/
public function setPerformanceData(string $performanceData = null): self
public function setPerformanceData(?string $performanceData = null): self
{
$this->performanceData = $performanceData;

Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Command/Transport/ApiCommandTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ protected function sendCommand(IcingaApiCommand $command)
* Send the Icinga command over the Icinga 2 API
*
* @param IcingaCommand|IcingaApiCommand $command
* @param int|null $now
* @param ?int $now
*
* @throws CommandTransportException
*
* @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
10 changes: 5 additions & 5 deletions library/Icingadb/Command/Transport/CommandTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ public static function createTransport(ConfigObject $config): ApiCommandTranspor
*
* This will try one configured transport after another until the command has been successfully sent.
*
* @param IcingaCommand $command The command to send
* @param int|null $now Timestamp of the command or null for now
* @param IcingaCommand $command The command to send
* @param ?int $now Timestamp of the command or null for now
*
* @throws CommandTransportException If sending the Icinga command failed
* @return mixed
*
* @return mixed
* @throws CommandTransportException If sending the Icinga command failed
*/
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 @@ -15,10 +15,10 @@ interface CommandTransportInterface
/**
* Send an Icinga command over the Icinga command transport
*
* @param IcingaCommand $command The command to send
* @param int|null $now Timestamp of the command or null for now
* @param IcingaCommand $command The command to send
* @param ?int $now Timestamp of the command or null for now
*
* @throws CommandTransportException If sending the Icinga command failed
* @throws CommandTransportException If sending the Icinga command failed
*/
public function send(IcingaCommand $command, int $now = null);
public function send(IcingaCommand $command, ?int $now = null);
}
4 changes: 3 additions & 1 deletion library/Icingadb/Common/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use ipl\Sql\QueryBuilder;
use ipl\Sql\Select;
use PDO;
use Pdo\Mysql;

/**
* Singleton providing access to the Icinga DB and Redis
Expand Down Expand Up @@ -61,7 +62,8 @@ 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"
$config->options[Mysql::ATTR_INIT_COMMAND]
= "SET SESSION SQL_MODE='STRICT_TRANS_TABLES"
. ",NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
}

Expand Down
8 changes: 4 additions & 4 deletions library/Icingadb/Common/HostStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public static function int(string $state): int
/**
* Get the textual representation of the passed host state
*
* @param int|null $state
* @param ?int $state
*
* @return string
*
* @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 All @@ -78,13 +78,13 @@ public static function text(int $state = null): string
/**
* Get the translated textual representation of the passed host state
*
* @param int|null $state
* @param ?int $state
*
* @return 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
16 changes: 8 additions & 8 deletions library/Icingadb/Common/IcingaRedis.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ protected function fetchState(string $key, array $ids, array $columns): Generato
/**
* Get the last icinga heartbeat from redis
*
* @param Redis|null $redis
* @param ?Redis $redis
*
* @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 All @@ -201,12 +201,12 @@ public static function getLastIcingaHeartbeat(Redis $redis = null)
/**
* Get the primary redis instance
*
* @param Config|null $moduleConfig
* @param Config|null $redisConfig
* @param ?Config $moduleConfig
* @param ?Config $redisConfig
*
* @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 @@ -235,12 +235,12 @@ public static function getPrimaryRedis(Config $moduleConfig = null, Config $redi
/**
* Get the secondary redis instance if exists
*
* @param Config|null $moduleConfig
* @param Config|null $redisConfig
* @param ?Config $moduleConfig
* @param ?Config $redisConfig
*
* @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
8 changes: 4 additions & 4 deletions library/Icingadb/Common/ServiceStates.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public static function int(string $state): int
/**
* Get the textual representation of the passed service state
*
* @param int|null $state
* @param ?int $state
*
* @return string
*
* @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 @@ -94,13 +94,13 @@ public static function text(int $state = null): string
/**
* Get the translated textual representation of the passed service state
*
* @param int|null $state
* @param ?int $state
*
* @return 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 @@ -118,7 +118,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
6 changes: 3 additions & 3 deletions library/Icingadb/Compat/UrlMigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,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 @@ -153,11 +153,11 @@ public static function transformParams(Url $url, string $transformerName = null)
* Transform the given legacy filter
*
* @param Filter\Rule $filter
* @param string|null $queryTransformer
* @param ?string $queryTransformer
*
* @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
38 changes: 19 additions & 19 deletions library/Icingadb/Data/PivotTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,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
* @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 @@ -128,11 +128,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
* @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 @@ -203,13 +203,13 @@ public function setYAxisHeader(string $yAxisHeader): self
/**
* Return the value for the given request parameter
*
* @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 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
*
* @return int
* @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 @@ -326,12 +326,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
* @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 @@ -358,12 +358,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
* @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 @@ -14,7 +14,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
2 changes: 1 addition & 1 deletion library/Icingadb/Model/Behavior/Bitmask.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function toDb($value, $key, $context)
public function rewriteCondition(Condition $condition, $relation = null)
{
$column = $condition->metaData()->get('columnName');
if (! isset($this->properties[$column])) {
if ($column === null || ! isset($this->properties[$column])) {
return;
}

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 @@ -86,7 +86,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 @@ -188,7 +188,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 @@ -45,7 +45,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 @@ -45,7 +45,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
Loading
Loading