Skip to content

Commit

Permalink
Fix a psalm issue with templates
Browse files Browse the repository at this point in the history
ArrayObject needs a Template definition for static analysis
  • Loading branch information
heiglandreas committed Apr 26, 2022
1 parent 52c6751 commit f0f2a99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/HolidayIterator.php
Expand Up @@ -34,8 +34,15 @@

use ArrayObject;

/**
* @template-extends ArrayObject<int, HolidayIteratorItemInterface>
*/
class HolidayIterator extends ArrayObject
{
/**
* @param mixed $value
* @return void
*/
public function append($value)
{
if (! $value instanceof HolidayIteratorItemInterface) {
Expand Down
1 change: 0 additions & 1 deletion src/Holidaychecker.php
Expand Up @@ -45,7 +45,6 @@ public function __construct(HolidayIterator $iterator)

public function check(DateTimeInterface $date): Holiday
{
/** @var HolidayIteratorItemInterface $entry */
foreach ($this->iterator as $entry) {
if ($entry->dateMatches($date)) {
return new Holiday($entry->isHoliday(), $entry->getName());
Expand Down

0 comments on commit f0f2a99

Please sign in to comment.