Skip to content

Commit

Permalink
chore(documentation): throws tag
Browse files Browse the repository at this point in the history
Adding in the `@throws` tag for the documentation
  • Loading branch information
awjudd committed Oct 7, 2021
1 parent cc95c4e commit ca41e3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Timezone
{
private DateTimeZone $timezone;

/**
* @throws InvalidTimezoneException
*/
public function __construct(string $timezone)
{
try {
Expand Down
9 changes: 8 additions & 1 deletion src/TimezoneList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use ArrayAccess;
use DateTimeZone;
use GamingEngine\Timezone\Exceptions\InvalidTimezoneException;
use GamingEngine\Timezone\Exceptions\TimezoneListReadonlyException;
use Iterator;

Expand All @@ -14,7 +15,7 @@ class TimezoneList implements ArrayAccess, Iterator
/**
* @var Timezone[]
*/
private array $timezones = [];
private array $timezones;

/**
* @param Timezone[] $timezones
Expand All @@ -25,11 +26,17 @@ private function __construct(array $timezones)
$this->timezones = $timezones;
}

/**
* @throws InvalidTimezoneException
*/
public static function all(): TimezoneList
{
return static::fromTimezoneGroup(DateTimeZone::ALL);
}

/**
* @throws InvalidTimezoneException
*/
public static function fromTimezoneGroup(int $timezoneGroup): TimezoneList
{
$timezones = [];
Expand Down

0 comments on commit ca41e3c

Please sign in to comment.