Skip to content

Commit

Permalink
Add DatePeriod::INCLUDE_END_DATE option
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed Feb 3, 2023
1 parent 234787b commit cad8c46
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions stubs/Php82.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,27 @@ namespace {
/** @return non-empty-list<ReflectionNamedType|ReflectionIntersectionType> */
public function getTypes(): array {}
}

/**
* @psalm-immutable
*
* @template-covariant Start of string|DateTimeInterface
* @implements IteratorAggregate<int, DateTimeInterface>
*/
class DatePeriod implements IteratorAggregate
{
const EXCLUDE_START_DATE = 1;
const INCLUDE_END_DATE = 2;

/**
* @param Start $start
* @param (Start is string ? int-mask<self::EXCLUDE_START_DATE, self::INCLUDE_END_DATE> : DateInterval) $interval
* @param (Start is string ? never : DateTimeInterface|positive-int) $end
* @param (Start is string ? never : int-mask<self::EXCLUDE_START_DATE, self::INCLUDE_END_DATE>) $options
*/
public function __construct($start, $interval = 0, $end = 1, $options = 0) {}

/** @psalm-return (Start is string ? (Traversable<int, DateTime>&Iterator) : (Traversable<int, Start>&Iterator)) */
public function getIterator(): Iterator {}
}
}

0 comments on commit cad8c46

Please sign in to comment.