Skip to content

Commit

Permalink
Add property type hint to Report model & update phpstan baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Sep 12, 2023
1 parent 618618d commit 6ccb9e3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 31 deletions.
12 changes: 12 additions & 0 deletions library/Reporting/Model/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,23 @@

namespace Icinga\Module\Reporting\Model;

use DateTime;
use ipl\Orm\Behavior\MillisecondTimestamp;
use ipl\Orm\Behaviors;
use ipl\Orm\Model;
use ipl\Orm\Relations;

/**
* A Report database model
*
* @property int $id Unique identifier of this model
* @property int $timeframe_id The timeframe id used by this report
* @property int $template_id The template id used by this report
* @property string $author The author of this report
* @property string $name The name of this report
* @property DateTime $ctime The creation time of this report
* @property DateTime $mtime Modify time of this report
*/
class Report extends Model
{
public function getTableName()
Expand Down
32 changes: 1 addition & 31 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,6 @@ parameters:
count: 1
path: application/controllers/ReportsController.php

-
message: "#^Cannot call method format\\(\\) on mixed\\.$#"
count: 2
path: application/controllers/ReportsController.php

-
message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\ReportsController\\:\\:indexAction\\(\\) has no return type specified\\.$#"
count: 1
Expand All @@ -190,11 +185,6 @@ parameters:
count: 1
path: application/controllers/ReportsController.php

-
message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplateController\\:\\:createTabs\\(\\) has no return type specified\\.$#"
count: 1
path: application/controllers/TemplateController.php

-
message: "#^Method Icinga\\\\Module\\\\Reporting\\\\Controllers\\\\TemplateController\\:\\:editAction\\(\\) has no return type specified\\.$#"
count: 1
Expand All @@ -215,14 +205,9 @@ parameters:
count: 1
path: application/controllers/TemplateController.php

-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, mixed given\\.$#"
count: 1
path: application/controllers/TemplateController.php

-
message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#"
count: 2
count: 1
path: application/controllers/TemplateController.php

-
Expand Down Expand Up @@ -685,21 +670,6 @@ parameters:
count: 1
path: library/Reporting/Report.php

-
message: "#^Property Icinga\\\\Module\\\\Reporting\\\\Report\\:\\:\\$author \\(string\\) does not accept mixed\\.$#"
count: 1
path: library/Reporting/Report.php

-
message: "#^Property Icinga\\\\Module\\\\Reporting\\\\Report\\:\\:\\$id \\(int\\) does not accept mixed\\.$#"
count: 1
path: library/Reporting/Report.php

-
message: "#^Property Icinga\\\\Module\\\\Reporting\\\\Report\\:\\:\\$name \\(string\\) does not accept mixed\\.$#"
count: 1
path: library/Reporting/Report.php

-
message: "#^Method Icinga\\\\Module\\\\Reporting\\\\ReportData\\:\\:getAverages\\(\\) has no return type specified\\.$#"
count: 1
Expand Down

0 comments on commit 6ccb9e3

Please sign in to comment.