Assert class instances of collection items
This commit is contained in:
parent
5ac1a6d95a
commit
c84e6ed25c
3 changed files with 10 additions and 0 deletions
|
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||
namespace Drupal\opd_daily_emails;
|
||||
|
||||
use Drupal\node\NodeInterface;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
final class DailyEmails implements \Countable {
|
||||
|
||||
|
@ -14,6 +15,7 @@ final class DailyEmails implements \Countable {
|
|||
private function __construct(
|
||||
private array $emails,
|
||||
) {
|
||||
Assert::allIsInstanceOf($emails, NodeInterface::class);
|
||||
}
|
||||
|
||||
public function count(): int {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue