diff --git a/src/EventsList.php b/src/EventsList.php index 241eb8c..cb00ec2 100644 --- a/src/EventsList.php +++ b/src/EventsList.php @@ -14,8 +14,6 @@ class EventsList extends ArrayObject { /** * Return array of Events - * - * @return array */ public function getArrayCopy(): array { return array_values(parent::getArrayCopy()); @@ -23,8 +21,6 @@ public function getArrayCopy(): array { /** * Return sorted EventList (the newest dates are first) - * - * @return $this */ public function sorted(): EventsList { $this->uasort(static function ($a, $b): int { @@ -39,8 +35,6 @@ public function sorted(): EventsList { /** * Return reversed sorted EventList (the oldest dates are first) - * - * @return $this */ public function reversed(): EventsList { $this->uasort(static function ($a, $b): int { diff --git a/src/Freq.php b/src/Freq.php index 892d8c9..b528a7d 100644 --- a/src/Freq.php +++ b/src/Freq.php @@ -35,8 +35,6 @@ * @license http://creativecommons.org/licenses/by-sa/2.5/dk/deed.en_GB CC-BY-SA-DK */ class Freq { - - /** @var bool */ public static bool $debug = false; protected array $weekdays = [ @@ -56,7 +54,7 @@ class Freq { 'yearday', 'hour', 'minute', - ]; //others : 'setpos', 'second' + ]; // others: 'setpos', 'second' protected array $ruleModifiers = ['wkst']; protected bool $simpleMode = true; @@ -73,8 +71,7 @@ class Freq { /** * Constructs a new Frequency-rule * - * @param array|string $rule - * @param int $start Unix-timestamp (important : Need to be the start of Event) + * @param int $start Unix-timestamp (important: Need to be the start of Event) * @param array $excluded of int (timestamps), see EXDATE documentation * @param array $added of int (timestamps), see RDATE documentation * @throws Exception @@ -188,8 +185,6 @@ private function isPrerule(string $rule, string $freq): bool { * If no new timestamps were found in the period, we try in the * next period * - * @param int $offset - * @return int|bool * @throws Exception */ public function findNext(int $offset): bool|int { @@ -295,11 +290,6 @@ public function findNext(int $offset): bool|int { /** * Finds the starting point for the next rule. It goes $interval * 'freq' forward in time since the given offset - * - * @param int $offset - * @param int $interval - * @param boolean $truncate - * @return int */ private function findStartingPoint(int $offset, int $interval, bool $truncate = true): int { $_freq = ($this->freq === 'daily') ? 'day__' : $this->freq; @@ -325,10 +315,6 @@ private function findStartingPoint(int $offset, int $interval, bool $truncate = * period specified by freq * * Yes - the fall-through is on purpose! - * - * @param int $time - * @param string $freq - * @return int */ private function truncateToPeriod(int $time, string $freq): int { $date = getdate($time); @@ -410,9 +396,6 @@ private function validDate($t): bool { /** * Finds the earliest timestamp possible outside this period. - * - * @param int $offset - * @return int */ public function findEndOfPeriod(int $offset = 0): int { return $this->findStartingPoint($offset, 1, false); @@ -494,7 +477,6 @@ public function lastOccurrence(): int { /** * Returns all timestamps array(), build the cache if not made before * - * @return array * @throws Exception */ public function getAllOccurrences(): array { @@ -519,10 +501,6 @@ public function getAllOccurrences(): array { /** * Applies the BYDAY rule to the given timestamp - * - * @param string $rule - * @param int $t - * @return int */ private function ruleByDay(string $rule, int $t): int { $dir = ($rule[0] === '-') ? -1 : 1; diff --git a/src/IcalParser.php b/src/IcalParser.php index 282deef..7c43442 100644 --- a/src/IcalParser.php +++ b/src/IcalParser.php @@ -17,17 +17,9 @@ * @author Roman Ožana */ class IcalParser { - - /** @var ?DateTimeZone */ public ?DateTimeZone $timezone = null; - - /** @var array|null */ public ?array $data = null; - - /** @var array */ protected array $counters = []; - - /** @var array */ private array $windowsTimezones; public function __construct() { @@ -35,12 +27,9 @@ public function __construct() { } /** - * @param string $file - * @param callable|null $callback - * @return array|null * @throws Exception */ - public function parseFile(string $file, callable $callback = null): ?array { + public function parseFile(string $file, ?callable $callback = null): ?array { if (!$handle = fopen($file, 'rb')) { throw new RuntimeException('Can\'t open file' . $file . ' for reading.'); } @@ -50,13 +39,10 @@ public function parseFile(string $file, callable $callback = null): ?array { } /** - * @param string $string - * @param callable|null $callback * @param boolean $add if true the parsed string is added to existing data - * @return array|null * @throws Exception */ - public function parseString(string $string, callable $callback = null, bool $add = false): ?array { + public function parseString(string $string, ?callable $callback = null, bool $add = false): ?array { if ($add === false) { // delete old data $this->data = []; diff --git a/src/Recurrence.php b/src/Recurrence.php index 7010257..fdf4c1b 100644 --- a/src/Recurrence.php +++ b/src/Recurrence.php @@ -38,8 +38,6 @@ class Recurrence { protected mixed $wkst; /** * A list of the properties that can have comma-separated lists for values. - * - * @var array */ protected array $listProperties = [ 'bysecond', 'byminute', 'byhour', 'byday', 'bymonthday', @@ -59,8 +57,6 @@ public function __construct(array $rrule) { /** * Parses an 'RRULE' array and sets the member variables of this object. * Expects a string that looks like this: 'FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,TU,WE' - * - * @param array $rrule */ protected function parseRrule(array $rrule): void { $this->rrule = $rrule;