Skip to content

Commit

Permalink
Source: Add columns newly added to the schema
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Jan 17, 2024
1 parent 4ba49e7 commit d1cb962
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 18 deletions.
27 changes: 24 additions & 3 deletions library/Notifications/Model/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,23 @@
use ipl\Web\Widget\IcingaIcon;
use ipl\Web\Widget\Icon;

/**
* @property int $id The primary key
* @property string $type Type identifier
* @property string $name The user-defined name
* @property ?string $listener_password_hash
* @property ?string $icinga2_base_url
* @property ?string $icinga2_auth_user
* @property ?string $icinga2_auth_pass
* @property ?string $icinga2_ca_pem
* @property ?string $icinga2_common_name
* @property string $icinga2_insecure_tls
*/
class Source extends Model
{
/** @var string The type name used by Icinga sources */
public const ICINGA_TYPE_NAME = 'icinga2';

public function getTableName()
{
return 'source';
Expand All @@ -25,7 +40,14 @@ public function getColumns()
{
return [
'type',
'name'
'name',
'listener_password_hash',
'icinga2_base_url',
'icinga2_auth_user',
'icinga2_auth_pass',
'icinga2_ca_pem',
'icinga2_common_name',
'icinga2_insecure_tls'
];
}

Expand Down Expand Up @@ -59,10 +81,9 @@ public function createRelations(Relations $relations)
*/
public function getIcon(): Icon
{
$icon = null;
switch ($this->type) {
//TODO(sd): Add icons for other known sources
case 'icinga2':
case self::ICINGA_TYPE_NAME:
$icon = new IcingaIcon('icinga');
break;
default:
Expand Down
15 changes: 0 additions & 15 deletions phpstan-baseline-standard.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1520,21 +1520,6 @@ parameters:
count: 1
path: library/Notifications/Widget/EventSourceBadge.php

-
message: "#^Parameter \\#2 \\$value of method ipl\\\\Html\\\\Attributes\\:\\:add\\(\\) expects array\\|bool\\|string\\|null, mixed given\\.$#"
count: 1
path: library/Notifications/Widget/EventSourceBadge.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
path: library/Notifications/Widget/EventSourceBadge.php

-
message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
path: library/Notifications/Widget/EventSourceBadge.php

-
message: "#^Method Icinga\\\\Module\\\\Notifications\\\\Widget\\\\FlowLine\\:\\:getHorizontalLine\\(\\) has no return type specified\\.$#"
count: 1
Expand Down

0 comments on commit d1cb962

Please sign in to comment.