@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Period; |
4 | 4 | |
5 | -use DateTime; |
|
6 | -use DatePeriod; |
|
7 | 5 | use DateInterval; |
6 | +use DatePeriod; |
|
7 | +use DateTime; |
|
8 | 8 | use DateTimeImmutable; |
9 | 9 | use DateTimeInterface; |
10 | 10 | use IteratorAggregate; |
11 | +use Spatie\Period\Exceptions\CannotComparePeriods; |
|
11 | 12 | use Spatie\Period\Exceptions\InvalidDate; |
12 | 13 | use Spatie\Period\Exceptions\InvalidPeriod; |
13 | -use Spatie\Period\Exceptions\CannotComparePeriods; |
|
14 | 14 | |
15 | 15 | class EndlessPeriod implements IteratorAggregate, PeriodInterface |
16 | 16 | { |
@@ -35,6 +35,11 @@ discard block |
||
35 | 35 | /** @var int */ |
36 | 36 | public $precisionMask; |
37 | 37 | |
38 | + /** |
|
39 | + * @param DateTimeImmutable|null $end |
|
40 | + * @param integer $precisionMask |
|
41 | + * @param integer $boundaryExclusionMask |
|
42 | + */ |
|
38 | 43 | public function __construct( |
39 | 44 | DateTimeImmutable $start, |
40 | 45 | ?DateTimeImmutable $end, |
@@ -326,6 +331,7 @@ discard block |
||
326 | 331 | |
327 | 332 | /** |
328 | 333 | * @param \Spatie\Period\Period ...$periods |
334 | + * @param Period[] $periods |
|
329 | 335 | * |
330 | 336 | * @return \Spatie\Period\PeriodCollection|static[] |
331 | 337 | */ |
@@ -348,8 +354,9 @@ discard block |
||
348 | 354 | |
349 | 355 | /** |
350 | 356 | * @param \Spatie\Period\Period ...$periods |
357 | + * @param Period[] $periods |
|
351 | 358 | * |
352 | - * @return static |
|
359 | + * @return Period |
|
353 | 360 | */ |
354 | 361 | public function overlapAll(PeriodInterface ...$periods): Period |
355 | 362 | { |
@@ -410,6 +417,7 @@ discard block |
||
410 | 417 | |
411 | 418 | /** |
412 | 419 | * @param \Spatie\Period\Period ...$periods |
420 | + * @param Period[] $periods |
|
413 | 421 | * |
414 | 422 | * @return \Spatie\Period\PeriodCollection|static[] |
415 | 423 | */ |
@@ -452,6 +460,9 @@ discard block |
||
452 | 460 | ); |
453 | 461 | } |
454 | 462 | |
463 | + /** |
|
464 | + * @param string|null $format |
|
465 | + */ |
|
455 | 466 | protected static function resolveDate($date, ?string $format): DateTimeImmutable |
456 | 467 | { |
457 | 468 | if ($date instanceof DateTimeImmutable) { |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | namespace Spatie\Period; |
4 | 4 | |
5 | -use DateTime; |
|
6 | -use DatePeriod; |
|
7 | 5 | use DateInterval; |
6 | +use DatePeriod; |
|
7 | +use DateTime; |
|
8 | 8 | use DateTimeImmutable; |
9 | 9 | use DateTimeInterface; |
10 | 10 | use IteratorAggregate; |
11 | +use Spatie\Period\Exceptions\CannotComparePeriods; |
|
11 | 12 | use Spatie\Period\Exceptions\InvalidDate; |
12 | 13 | use Spatie\Period\Exceptions\InvalidPeriod; |
13 | -use Spatie\Period\Exceptions\CannotComparePeriods; |
|
14 | 14 | |
15 | 15 | class Period implements IteratorAggregate, PeriodInterface |
16 | 16 | { |