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
20 changes: 10 additions & 10 deletions app/cdash/app/Model/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,20 @@ class Subscriber implements SubscriberInterface
/** @var TopicCollection */
private $topics;

/** @var User */
private $user;
private $UserId;
private $Email;
private Collection $LabelCollection;

/**
* Subscriber constructor.
*/
public function __construct(
NotificationPreferences $preferences,
?TopicCollection $topics = null,
?User $user = null,
) {
$this->preferences = $preferences;
$this->topics = $topics;
$this->user = $user ? $user : new User();
$this->LabelCollection = collect();
}

public function hasBuildTopics(ActionableBuildInterface $submission): bool
Expand Down Expand Up @@ -94,24 +94,24 @@ public function getTopics(): TopicCollection

public function getAddress(): string
{
return $this->user->Email;
return $this->Email;
}

public function setAddress($address): static
{
$this->user->Email = $address;
$this->Email = $address;
return $this;
}

public function getLabels(): Collection
{
return $this->user->GetLabelCollection();
return $this->LabelCollection;
}

public function setLabels(array $labels): static
{
foreach ($labels as $label) {
$this->user->AddLabel($label);
$this->LabelCollection->put($label->Text, $label);
}
return $this;
}
Expand All @@ -123,12 +123,12 @@ public function getNotificationPreferences(): NotificationPreferences

public function setUserId($userId): static
{
$this->user->Id = $userId;
$this->UserId = $userId;
return $this;
}

public function getUserId()
{
return $this->user->Id;
return $this->UserId;
}
}
56 changes: 0 additions & 56 deletions app/cdash/app/Model/User.php

This file was deleted.

102 changes: 9 additions & 93 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11376,60 +11376,6 @@ parameters:
count: 2
path: app/cdash/app/Model/SubProjectGroup.php

-
rawMessage: '''
Access to property $Email of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: property.deprecatedClass
count: 2
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Access to property $Id of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: property.deprecatedClass
count: 2
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Call to method AddLabel() of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: method.deprecatedClass
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Call to method GetLabelCollection() of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: method.deprecatedClass
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Call to method __construct() of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: method.deprecatedClass
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Instantiation of deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: new.deprecatedClass
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: 'Loose comparison via "==" is not allowed.'
identifier: equal.notAllowed
Expand Down Expand Up @@ -11467,38 +11413,32 @@ parameters:
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: 'Only booleans are allowed in a ternary operator condition, CDash\Model\User|null given.'
identifier: ternary.condNotBoolean
rawMessage: 'Parameter #1 $build of method CDash\Messaging\Topic\Topic::addBuild() expects CDash\Model\Build, mixed given.'
identifier: argument.type
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: 'Parameter #1 $build of method CDash\Messaging\Topic\Topic::addBuild() expects CDash\Model\Build, mixed given.'
rawMessage: 'Parameter #1 $build of method CDash\Messaging\Topic\TopicInterface::subscribesToBuild() expects CDash\Model\Build, mixed given.'
identifier: argument.type
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: 'Parameter #1 $build of method CDash\Messaging\Topic\TopicInterface::subscribesToBuild() expects CDash\Model\Build, mixed given.'
identifier: argument.type
rawMessage: Property CDash\Model\Subscriber::$Email has no type specified.
identifier: missingType.property
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Parameter $user of method CDash\Model\Subscriber::__construct() has typehint with deprecated class CDash\Model\User:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: parameter.deprecatedClass
rawMessage: 'Property CDash\Model\Subscriber::$LabelCollection with generic class Illuminate\Support\Collection does not specify its types: TKey, TValue'
identifier: missingType.generics
count: 1
path: app/cdash/app/Model/Subscriber.php

-
rawMessage: '''
Property $user references deprecated class CDash\Model\User in its type:
04/22/2025 Used only in the legacy notification system. Use Eloquent for new work.
'''
identifier: property.deprecatedClass
rawMessage: Property CDash\Model\Subscriber::$UserId has no type specified.
identifier: missingType.property
count: 1
path: app/cdash/app/Model/Subscriber.php

Expand All @@ -11520,30 +11460,6 @@ parameters:
count: 1
path: app/cdash/app/Model/SubscriberInterface.php

-
rawMessage: 'Method CDash\Model\User::GetLabelCollection() return type with generic class Illuminate\Support\Collection does not specify its types: TKey, TValue'
identifier: missingType.generics
count: 1
path: app/cdash/app/Model/User.php

-
rawMessage: Property CDash\Model\User::$Email has no type specified.
identifier: missingType.property
count: 1
path: app/cdash/app/Model/User.php

-
rawMessage: Property CDash\Model\User::$Id has no type specified.
identifier: missingType.property
count: 1
path: app/cdash/app/Model/User.php

-
rawMessage: 'Property CDash\Model\User::$LabelCollection with generic class Illuminate\Support\Collection does not specify its types: TKey, TValue'
identifier: missingType.generics
count: 1
path: app/cdash/app/Model/User.php

-
rawMessage: Cannot access property $Revision on CDash\Model\BuildUpdate|null.
identifier: property.nonObject
Expand Down