mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-23 09:57:58 +02:00
Fix some signature inconsistencies
This commit is contained in:
parent
7800c699b7
commit
0ad7fdca53
@ -185,7 +185,7 @@ class DashletManager
|
||||
*
|
||||
* @param Dashlet $dashlet
|
||||
*
|
||||
* @return void
|
||||
* @return bool
|
||||
*/
|
||||
public static function ensureItIsNotOrphaned(Dashlet $dashlet): bool
|
||||
{
|
||||
|
@ -64,7 +64,6 @@ trait Database
|
||||
|
||||
$insert->values(array_combine($insert->getColumns(), $values));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
return $conn;
|
||||
|
@ -286,11 +286,11 @@ abstract class BaseDashboard implements DashboardEntry
|
||||
{
|
||||
}
|
||||
|
||||
public function manageEntry($entry, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
public function manageEntry($entryOrEntries, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
{
|
||||
}
|
||||
|
||||
public function loadDashboardEntries(string $name = '')
|
||||
public function loadDashboardEntries(string $name = null)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -105,14 +105,14 @@ interface DashboardEntry
|
||||
* move pane(s)|dashlet(s) from another to this widget you have to also provide the origin from which the
|
||||
* given entry(ies) originated
|
||||
*
|
||||
* @param BaseDashboard|BaseDashboard[] $entry The actual dashboard entry to be managed
|
||||
* @param BaseDashboard|BaseDashboard[] $entryOrEntries The actual dashboard entry to be managed
|
||||
* @param ?BaseDashboard $origin The original widget from which the given entry originates
|
||||
* @param bool $manageRecursive Whether the given entry should be managed recursively e.g if the given entry
|
||||
* is a Pane type, all its dashlets can be managed recursively
|
||||
* is a {@see Pane} type, all its dashlets can be managed recursively
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function manageEntry($entry, BaseDashboard $origin = null, bool $manageRecursive = false);
|
||||
public function manageEntry($entryOrEntries, BaseDashboard $origin = null, bool $manageRecursive = false);
|
||||
|
||||
/**
|
||||
* Load all the assigned entries to this widget
|
||||
@ -121,7 +121,7 @@ interface DashboardEntry
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function loadDashboardEntries(string $name = '');
|
||||
public function loadDashboardEntries(string $name = null);
|
||||
|
||||
/**
|
||||
* Reset the current position of the internal dashboard entries pointer
|
||||
|
@ -72,7 +72,7 @@ trait DashboardManager
|
||||
return sha1($name, true);
|
||||
}
|
||||
|
||||
public function loadDashboardEntries(string $name = '')
|
||||
public function loadDashboardEntries(string $name = null)
|
||||
{
|
||||
$home = $this->getEntry($name);
|
||||
$home->loadDashboardEntries();
|
||||
@ -137,10 +137,10 @@ trait DashboardManager
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function manageEntry($entry, BaseDashboard $origin = null, $manageRecursive = false)
|
||||
public function manageEntry($entryOrEntries, BaseDashboard $origin = null, $manageRecursive = false)
|
||||
{
|
||||
$conn = DBUtils::getConn();
|
||||
$homes = is_array($entry) ? $entry : [$entry];
|
||||
$homes = is_array($entryOrEntries) ? $entryOrEntries : [$entryOrEntries];
|
||||
|
||||
/** @var DashboardHome $home */
|
||||
foreach ($homes as $home) {
|
||||
|
@ -136,7 +136,7 @@ class DashboardHome extends BaseDashboard implements Sortable
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function loadDashboardEntries(string $name = '')
|
||||
public function loadDashboardEntries(string $name = null)
|
||||
{
|
||||
$this->setEntries([]);
|
||||
$panes = \Icinga\Model\Pane::on(DBUtils::getConn())->utilize(self::TABLE);
|
||||
@ -172,12 +172,12 @@ class DashboardHome extends BaseDashboard implements Sortable
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function manageEntry($entry, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
public function manageEntry($entryOrEntries, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
{
|
||||
$user = Dashboard::getUser();
|
||||
$conn = DBUtils::getConn();
|
||||
|
||||
$panes = is_array($entry) ? $entry : [$entry];
|
||||
$panes = is_array($entryOrEntries) ? $entryOrEntries : [$entryOrEntries];
|
||||
// Highest priority is 0, so count($entries) are all always lowest prio + 1
|
||||
$order = count($this->getEntries());
|
||||
|
||||
|
@ -89,7 +89,7 @@ class Pane extends BaseDashboard implements Sortable
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function loadDashboardEntries(string $name = '')
|
||||
public function loadDashboardEntries(string $name = null)
|
||||
{
|
||||
$dashlets = Model\Dashlet::on(DBUtils::getConn())
|
||||
->utilize(self::TABLE)
|
||||
@ -117,8 +117,7 @@ class Pane extends BaseDashboard implements Sortable
|
||||
|
||||
$this->addEntry($newDashlet);
|
||||
|
||||
if (
|
||||
Modules\DashletManager::isOrphaned($newDashlet)
|
||||
if (Modules\DashletManager::isOrphaned($newDashlet)
|
||||
|| (
|
||||
$newDashlet->isModuleDashlet()
|
||||
&& $dashlet->system_module_dashlet_id === null
|
||||
@ -149,7 +148,7 @@ class Pane extends BaseDashboard implements Sortable
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function manageEntry($entry, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
public function manageEntry($entryOrEntries, BaseDashboard $origin = null, bool $manageRecursive = false)
|
||||
{
|
||||
if ($origin && ! $origin instanceof Pane) {
|
||||
throw new \InvalidArgumentException(sprintf(
|
||||
@ -169,7 +168,7 @@ class Pane extends BaseDashboard implements Sortable
|
||||
$user = Dashboard::getUser()->getUsername();
|
||||
$conn = DBUtils::getConn();
|
||||
|
||||
$dashlets = is_array($entry) ? $entry : [$entry];
|
||||
$dashlets = is_array($entryOrEntries) ? $entryOrEntries : [$entryOrEntries];
|
||||
// Highest priority is 0, so count($entries) are always lowest prio + 1
|
||||
$order = count($this->getEntries());
|
||||
foreach ($dashlets as $dashlet) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user