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/forms/DimensionsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,24 @@
public function assemble()
{
$dimensions = $this->cube->listDimensions();
$cnt = count($dimensions);

Check failure on line 76 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $value of function count expects array|Countable, mixed given.

Check failure on line 76 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $value of function count expects array|Countable, mixed given.

Check failure on line 76 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $value of function count expects array|Countable, mixed given.

Check failure on line 76 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $value of function count expects array|Countable, mixed given.

if ($cnt < 3) {
$allDimensions = $this->cube->listAdditionalDimensions();

$this->addElement('select', 'addDimension', [
'options' => [null => $this->translate('+ Add a dimension')] + $allDimensions,
'options' => ['' => $this->translate('+ Add a dimension')] + $allDimensions,

Check failure on line 82 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between array{'': string} and mixed results in an error.

Check failure on line 82 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between array{'': string} and mixed results in an error.

Check failure on line 82 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between array{'': string} and mixed results in an error.

Check failure on line 82 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between array{'': string} and mixed results in an error.
'class' => 'autosubmit'
]);
}

$pos = 0;
foreach ($dimensions as $dimension) {

Check failure on line 88 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 88 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 88 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 88 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.
$this->addDimensionButtons($dimension, $pos++, $cnt);

Check failure on line 89 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addDimensionButtons() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 89 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addDimensionButtons() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 89 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addDimensionButtons() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 89 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addDimensionButtons() expects Icinga\Module\Cube\Dimension, mixed given.
}

foreach ($this->cube->getSlices() as $key => $value) {

Check failure on line 92 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 92 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 92 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.

Check failure on line 92 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Argument of an invalid type mixed supplied for foreach, only iterables are supported.
$this->addSlice($this->cube->getDimension($key), $value);

Check failure on line 93 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addSlice() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 93 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addSlice() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 93 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addSlice() expects Icinga\Module\Cube\Dimension, mixed given.

Check failure on line 93 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #1 $dimension of method Icinga\Module\Cube\Forms\DimensionsForm::addSlice() expects Icinga\Module\Cube\Dimension, mixed given.
}

$this->addElement($this->createUidElement());
Expand All @@ -113,7 +113,7 @@
$sliceFieldset->addHtml(Html::tag(
'span',
['class' => 'dimension-name'],
sprintf('%s: %s = %s', $this->translate('Slice/Filter'), $dimension->getLabel(), $value)

Check failure on line 116 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 116 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 116 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.

Check failure on line 116 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Parameter #4 ...$values of function sprintf expects bool|float|int|string|null, mixed given.
));

$this->addHtml($sliceFieldset);
Expand Down Expand Up @@ -145,7 +145,7 @@
$dimensionFieldset->addHtml($btn);
}

if ($pos + 1 !== $total) {

Check failure on line 148 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between mixed and 1 results in an error.

Check failure on line 148 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between mixed and 1 results in an error.

Check failure on line 148 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between mixed and 1 results in an error.

Check failure on line 148 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Binary operation "+" between mixed and 1 results in an error.
$btn = $this->createElement('submitButton', 'moveDimensionDown_' . $dimensionId, [
'label' => new Icon('angle-double-down'),
'title' => sprintf($this->translate('Move dimension "%s" down'), $dimension->getLabel()),
Expand All @@ -166,7 +166,7 @@
$url = $this->getUrl();

if ($dimension = $this->getValue('addDimension')) {
$url->setParam('dimensions', DimensionParams::fromUrl($url)->add($dimension)->getParams());

Check failure on line 169 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Cannot call method add() on mixed.

Check failure on line 169 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Cannot call method add() on mixed.

Check failure on line 169 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Cannot call method add() on mixed.

Check failure on line 169 in application/forms/DimensionsForm.php

View workflow job for this annotation

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

Cannot call method add() on mixed.
Notification::success($this->translate('New dimension has been added'));
} else {
$updateDimensions = false;
Expand Down
4 changes: 2 additions & 2 deletions library/Cube/Cube.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ public function listColumns()

/**
* @param View $view
* @param CubeRenderer $renderer
* @param ?CubeRenderer $renderer
* @return string
*/
public function render(View $view, CubeRenderer $renderer = null)
public function render(View $view, ?CubeRenderer $renderer = null)
{
if ($renderer === null) {
$renderer = $this->getRenderer();
Expand Down
4 changes: 2 additions & 2 deletions library/Cube/Hook/IcingaDbActionsHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ final protected function addActionLink(Url $url, string $title, string $descript
* Helper method instantiating an Url object
*
* @param string $path
* @param array $params
* @param ?array $params
* @return Url
*/
final protected function makeUrl(string $path, array $params = null): Url
final protected function makeUrl(string $path, ?array $params = null): Url
{
$url = Url::fromPath($path);
if ($params !== null) {
Expand Down
2 changes: 1 addition & 1 deletion library/Cube/Ido/DataView/Hoststatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class Hoststatus extends \Icinga\Module\Monitoring\DataView\Hoststatus
{
public function __construct(ConnectionInterface $connection, array $columns = null)
public function __construct(ConnectionInterface $connection, ?array $columns = null)
{
$this->connection = $connection;
$this->query = new HoststatusQuery($connection->getResource(), $columns);
Expand Down
Loading