Skip to content

Commit

Permalink
Fix dynamically-defined properties
Browse files Browse the repository at this point in the history
  • Loading branch information
williamjallen committed Mar 30, 2024
1 parent e8a4aa9 commit 06d2160
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 24 deletions.
1 change: 1 addition & 0 deletions app/cdash/app/Model/BuildConfigure.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class BuildConfigure
public $BuildId;
public $NumberOfWarnings;
public $NumberOfErrors;
public $LabelCollection;
private $Crc32;

private $PDO;
Expand Down
2 changes: 1 addition & 1 deletion app/cdash/app/Model/BuildErrorFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class BuildErrorFilter
{
private $ErrorsFilter;
private $WarningsFilter;

public $Project;
private $PDO;

public function __construct(Project $project)
{
Expand Down
3 changes: 0 additions & 3 deletions app/cdash/tests/test_buildgetdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public function testBuildGetDate()
$build->StartTime = $evening_after;

$expected_date = '2009-02-24';
$build->NightlyStartTime = false;
$date = $build->GetDate();
if ($date !== $expected_date) {
$this->fail("Evening case: expected $expected_date, found $date");
Expand All @@ -56,15 +55,13 @@ public function testBuildGetDate()
$build->GetProject()->SetNightlyTime('09:00:00 America/New_York');
$build->StartTime = $morning_before;
$expected_date = '2009-02-22';
$build->NightlyStartTime = false;
$date = $build->GetDate();
if ($date !== $expected_date) {
$this->fail("Morning case: expected $expected_date, found $date");
}

$build->StartTime = $morning_after;
$expected_date = '2009-02-23';
$build->NightlyStartTime= false;
$date = $build->GetDate();
if ($date !== $expected_date) {
$this->fail("Morning case: expected $expected_date, found $date");
Expand Down
1 change: 1 addition & 0 deletions app/cdash/xml_handlers/done_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class DoneHandler extends AbstractHandler
private $FinalAttempt;
private $PendingSubmissions;
private $Requeue;
public $backupFileName;

public function __construct($projectID)
{
Expand Down
3 changes: 3 additions & 0 deletions app/cdash/xml_handlers/testing_handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class TestingHandler extends AbstractHandler implements ActionableBuildInterface
private $TestMeasurement;
private $Label;

// TODO: Evaluate whether this is needed
private $Labels;

private $TestCreator;

/** @var Build[] Builds */
Expand Down
40 changes: 20 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -6774,11 +6774,6 @@ parameters:
count: 1
path: app/cdash/app/Model/Build.php

-
message: "#^Access to an undefined property CDash\\\\Model\\\\BuildConfigure\\:\\:\\$LabelCollection\\.$#"
count: 5
path: app/cdash/app/Model/BuildConfigure.php

-
message: """
#^Call to deprecated function add_log\\(\\)\\:
Expand Down Expand Up @@ -6881,6 +6876,11 @@ parameters:
count: 1
path: app/cdash/app/Model/BuildConfigure.php

-
message: "#^Property CDash\\\\Model\\\\BuildConfigure\\:\\:\\$LabelCollection has no type specified\\.$#"
count: 1
path: app/cdash/app/Model/BuildConfigure.php

-
message: "#^Property CDash\\\\Model\\\\BuildConfigure\\:\\:\\$Log has no type specified\\.$#"
count: 1
Expand Down Expand Up @@ -7153,11 +7153,6 @@ parameters:
count: 1
path: app/cdash/app/Model/BuildError.php

-
message: "#^Access to an undefined property CDash\\\\Model\\\\BuildErrorFilter\\:\\:\\$PDO\\.$#"
count: 8
path: app/cdash/app/Model/BuildErrorFilter.php

-
message: "#^Argument of an invalid type array\\<int, string\\>\\|false supplied for foreach, only iterables are supported\\.$#"
count: 1
Expand Down Expand Up @@ -7258,6 +7253,11 @@ parameters:
count: 1
path: app/cdash/app/Model/BuildErrorFilter.php

-
message: "#^Property CDash\\\\Model\\\\BuildErrorFilter\\:\\:\\$PDO has no type specified\\.$#"
count: 1
path: app/cdash/app/Model/BuildErrorFilter.php

-
message: "#^Property CDash\\\\Model\\\\BuildErrorFilter\\:\\:\\$Project has no type specified\\.$#"
count: 1
Expand Down Expand Up @@ -21139,11 +21139,6 @@ parameters:
count: 1
path: app/cdash/tests/test_buildfailuredetails.php

-
message: "#^Access to an undefined property CDash\\\\Model\\\\Build\\:\\:\\$NightlyStartTime\\.$#"
count: 1
path: app/cdash/tests/test_buildgetdate.php

-
message: "#^Method BuildGetDateTestCase\\:\\:testBuildGetDate\\(\\) has no return type specified\\.$#"
count: 1
Expand Down Expand Up @@ -27877,6 +27872,11 @@ parameters:
count: 1
path: app/cdash/xml_handlers/done_handler.php

-
message: "#^Property DoneHandler\\:\\:\\$backupFileName has no type specified\\.$#"
count: 1
path: app/cdash/xml_handlers/done_handler.php

-
message: "#^Access to an undefined property DynamicAnalysisHandler\\:\\:\\$BuildName\\.$#"
count: 5
Expand Down Expand Up @@ -28593,11 +28593,6 @@ parameters:
count: 1
path: app/cdash/xml_handlers/stack.php

-
message: "#^Access to an undefined property TestingHandler\\:\\:\\$Labels\\.$#"
count: 3
path: app/cdash/xml_handlers/testing_handler.php

-
message: "#^Call to an undefined method CDash\\\\Messaging\\\\Preferences\\\\NotificationPreferencesInterface\\:\\:get\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -28733,6 +28728,11 @@ parameters:
count: 1
path: app/cdash/xml_handlers/testing_handler.php

-
message: "#^Property TestingHandler\\:\\:\\$Labels has no type specified\\.$#"
count: 1
path: app/cdash/xml_handlers/testing_handler.php

-
message: "#^Property TestingHandler\\:\\:\\$NumberTestsFailed has no type specified\\.$#"
count: 1
Expand Down

0 comments on commit 06d2160

Please sign in to comment.