diff --git a/lib/BirthdayCalendarGenerator.php b/lib/BirthdayCalendarGenerator.php index a018f806..49793b0d 100644 --- a/lib/BirthdayCalendarGenerator.php +++ b/lib/BirthdayCalendarGenerator.php @@ -34,8 +34,6 @@ class BirthdayCalendarGenerator * * Check the setTimeRange and setObjects methods for details about the * arguments. - * - * @param mixed $objects */ public function __construct($objects = null) { @@ -49,8 +47,6 @@ public function __construct($objects = null) * * You must either supply a vCard as a string or as a Component/VCard object. * It's also possible to supply an array of strings or objects. - * - * @param mixed $objects */ public function setObjects($objects): void { diff --git a/lib/Component.php b/lib/Component.php index 50064306..da2c5ebd 100644 --- a/lib/Component.php +++ b/lib/Component.php @@ -450,8 +450,6 @@ public function __isset(string $name): bool * * If the item already exists, it will be removed. If you want to add * a new item with the same name, always use the add() method. - * - * @param mixed $value */ public function __set(string $name, $value): void { diff --git a/lib/Component/VAvailability.php b/lib/Component/VAvailability.php index 54031602..ff6e9bd6 100644 --- a/lib/Component/VAvailability.php +++ b/lib/Component/VAvailability.php @@ -36,8 +36,8 @@ public function isInTimeRange(\DateTimeInterface $start, \DateTimeInterface $end list($effectiveStart, $effectiveEnd) = $this->getEffectiveStartEnd(); return - (is_null($effectiveStart) || $start < $effectiveEnd) && - (is_null($effectiveEnd) || $end > $effectiveStart) + (is_null($effectiveStart) || $start < $effectiveEnd) + && (is_null($effectiveEnd) || $end > $effectiveStart) ; } diff --git a/lib/Component/VCalendar.php b/lib/Component/VCalendar.php index e5bbbdd5..b317e02c 100644 --- a/lib/Component/VCalendar.php +++ b/lib/Component/VCalendar.php @@ -166,7 +166,7 @@ public function getDocumentType(): int * * @return VObject\Component[] */ - public function getBaseComponents(?string $componentName = null): array + public function getBaseComponents(string $componentName = null): array { $isBaseComponent = function ($component): bool { if (!$component instanceof VObject\Component) { @@ -217,7 +217,7 @@ public function getBaseComponents(?string $componentName = null): array * * @return VObject\Component|null */ - public function getBaseComponent(?string $componentName = null): ?Component + public function getBaseComponent(string $componentName = null): ?Component { $isBaseComponent = function ($component): bool { if (!$component instanceof VObject\Component) { @@ -275,7 +275,7 @@ public function getBaseComponent(?string $componentName = null): ?Component * @throws InvalidDataException * @throws VObject\Recur\MaxInstancesExceededException */ - public function expand(\DateTimeInterface $start, \DateTimeInterface $end, ?\DateTimeZone $timeZone = null): VCalendar + public function expand(\DateTimeInterface $start, \DateTimeInterface $end, \DateTimeZone $timeZone = null): VCalendar { $newChildren = []; $recurringEvents = []; diff --git a/lib/Component/VCard.php b/lib/Component/VCard.php index 0f2a5e26..2ace81e5 100644 --- a/lib/Component/VCard.php +++ b/lib/Component/VCard.php @@ -272,17 +272,17 @@ public function validate(int $options = 0): array } $repaired = true; - // Otherwise, the ORG property may work + // Otherwise, the ORG property may work } elseif (isset($this->ORG)) { $this->FN = (string) $this->ORG; $repaired = true; - // Otherwise, the NICKNAME property may work + // Otherwise, the NICKNAME property may work } elseif (isset($this->NICKNAME)) { $this->FN = (string) $this->NICKNAME; $repaired = true; - // Otherwise, the EMAIL property may work + // Otherwise, the EMAIL property may work } elseif (isset($this->EMAIL)) { $this->FN = (string) $this->EMAIL; $repaired = true; diff --git a/lib/Component/VTodo.php b/lib/Component/VTodo.php index 35b34dce..bda49da7 100644 --- a/lib/Component/VTodo.php +++ b/lib/Component/VTodo.php @@ -52,8 +52,8 @@ public function isInTimeRange(\DateTimeInterface $start, \DateTimeInterface $end return $start <= $effectiveEnd && $end > $dtstart; } elseif ($due) { return - ($start < $due || $start <= $dtstart) && - ($end > $dtstart || $end >= $due); + ($start < $due || $start <= $dtstart) + && ($end > $dtstart || $end >= $due); } else { return $start <= $dtstart && $end > $dtstart; } @@ -63,8 +63,8 @@ public function isInTimeRange(\DateTimeInterface $start, \DateTimeInterface $end } if ($completed && $created) { return - ($start <= $created || $start <= $completed) && - ($end >= $created || $end >= $completed); + ($start <= $created || $start <= $completed) + && ($end >= $created || $end >= $completed); } if ($completed) { return $start <= $completed && $end >= $completed; diff --git a/lib/DateTimeParser.php b/lib/DateTimeParser.php index adb2a934..4a71931a 100644 --- a/lib/DateTimeParser.php +++ b/lib/DateTimeParser.php @@ -27,7 +27,7 @@ class DateTimeParser * * @throws InvalidDataException */ - public static function parseDateTime(string $dt, ?\DateTimeZone $tz = null): \DateTimeImmutable + public static function parseDateTime(string $dt, \DateTimeZone $tz = null): \DateTimeImmutable { // Format is YYYYMMDD + "T" + hhmmss $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])T([0-2][0-9])([0-5][0-9])([0-5][0-9])([Z]?)$/', $dt, $matches); @@ -54,7 +54,7 @@ public static function parseDateTime(string $dt, ?\DateTimeZone $tz = null): \Da * * @throws InvalidDataException */ - public static function parseDate(string $date, ?\DateTimeZone $tz = null): \DateTimeImmutable + public static function parseDate(string $date, \DateTimeZone $tz = null): \DateTimeImmutable { // Format is YYYYMMDD $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/', $date, $matches); diff --git a/lib/Document.php b/lib/Document.php index 5d5fd39c..b311987d 100644 --- a/lib/Document.php +++ b/lib/Document.php @@ -116,8 +116,6 @@ public function getDocumentType(): int * * If it's a known component, we will automatically call createComponent. * otherwise, we'll assume it's a property and call createProperty instead. - * - * @return mixed */ public function create(string $name) { @@ -142,7 +140,7 @@ public function create(string $name) * an iCalendar object, this may be something like CALSCALE:GREGORIAN. To * ensure that this does not happen, set $defaults to false. */ - public function createComponent(string $name, ?array $children = null, bool $defaults = true): Component + public function createComponent(string $name, array $children = null, bool $defaults = true): Component { $name = strtoupper($name); $class = Component::class; @@ -167,12 +165,11 @@ public function createComponent(string $name, ?array $children = null, bool $def * parameters will automatically be created, or you can just pass a list of * Parameter objects. * - * @param mixed $value * @param string|null $valueType Force a specific valueType, such as URI or TEXT * * @throws InvalidDataException */ - public function createProperty(string $name, $value = null, ?array $parameters = null, ?string $valueType = null): Property + public function createProperty(string $name, $value = null, array $parameters = null, string $valueType = null): Property { // If there's a . in the name, it means it's prefixed by a group name. if (false !== ($i = strpos($name, '.'))) { diff --git a/lib/ElementList.php b/lib/ElementList.php index 24794dd2..9c81b774 100644 --- a/lib/ElementList.php +++ b/lib/ElementList.php @@ -19,8 +19,7 @@ class ElementList extends \ArrayIterator /** * Sets an item through ArrayAccess. * - * @param int $offset - * @param mixed $value + * @param int $offset */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void diff --git a/lib/FreeBusyGenerator.php b/lib/FreeBusyGenerator.php index 6aa14f64..2f222e4e 100644 --- a/lib/FreeBusyGenerator.php +++ b/lib/FreeBusyGenerator.php @@ -71,10 +71,8 @@ class FreeBusyGenerator * * Check the setTimeRange and setObjects methods for details about the * arguments. - * - * @param mixed $objects */ - public function __construct(?\DateTimeInterface $start = null, ?\DateTimeInterface $end = null, $objects = null, ?\DateTimeZone $timeZone = null) + public function __construct(\DateTimeInterface $start = null, \DateTimeInterface $end = null, $objects = null, \DateTimeZone $timeZone = null) { $this->setTimeRange($start, $end); @@ -114,8 +112,6 @@ public function setVAvailability(Document $vcalendar): void * You must either specify a vcalendar object as a string, or as the parse * Component. * It's also possible to specify multiple objects as an array. - * - * @param mixed $objects */ public function setObjects($objects): void { @@ -142,7 +138,7 @@ public function setObjects($objects): void * * @throws \Exception */ - public function setTimeRange(?\DateTimeInterface $start = null, ?\DateTimeInterface $end = null): void + public function setTimeRange(\DateTimeInterface $start = null, \DateTimeInterface $end = null): void { if (!$start) { $start = new \DateTimeImmutable(Settings::$minDate); @@ -243,8 +239,8 @@ function ($a, $b) { foreach ($new as $higherVavail) { list($higherStart, $higherEnd) = $higherVavail->getEffectiveStartEnd(); if ( - (is_null($higherStart) || $higherStart < $compStart) && - (is_null($higherEnd) || $higherEnd > $compEnd) + (is_null($higherStart) || $higherStart < $compStart) + && (is_null($higherEnd) || $higherEnd > $compEnd) ) { // Component is fully covered by a higher priority // component. We can skip this component. diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php index 6d627537..f792fd99 100644 --- a/lib/ITip/Broker.php +++ b/lib/ITip/Broker.php @@ -268,7 +268,7 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null): array * This is message from an organizer, and is either a new event * invite, or an update to an existing one. */ - protected function processMessageRequest(Message $itipMessage, ?VCalendar $existingObject = null): ?VCalendar + protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null): ?VCalendar { if (!$existingObject) { // This is a new invite, and we're just going to copy over @@ -296,7 +296,7 @@ protected function processMessageRequest(Message $itipMessage, ?VCalendar $exist * attendee got removed from an event, or an event got cancelled * altogether. */ - protected function processMessageCancel(Message $itipMessage, ?VCalendar $existingObject = null): ?VCalendar + protected function processMessageCancel(Message $itipMessage, VCalendar $existingObject = null): ?VCalendar { if (!$existingObject) { // The event didn't exist in the first place, so we're just @@ -321,7 +321,7 @@ protected function processMessageCancel(Message $itipMessage, ?VCalendar $existi * @throws MaxInstancesExceededException * @throws NoInstancesException */ - protected function processMessageReply(Message $itipMessage, ?VCalendar $existingObject = null): ?VCalendar + protected function processMessageReply(Message $itipMessage, VCalendar $existingObject = null): ?VCalendar { // A reply can only be processed based on an existing object. // If the object is not available, the reply is ignored. @@ -545,10 +545,10 @@ protected function parseEventForOrganizer(VCalendar $calendar, array $eventInfo, $newAttendeeInstances = array_keys($attendee['newInstances']); $message->significantChange = - 'REQUEST' === $attendee['forceSend'] || - count($oldAttendeeInstances) != count($newAttendeeInstances) || - count(array_diff($oldAttendeeInstances, $newAttendeeInstances)) > 0 || - $oldEventInfo['significantChangeHash'] !== $eventInfo['significantChangeHash']; + 'REQUEST' === $attendee['forceSend'] + || count($oldAttendeeInstances) != count($newAttendeeInstances) + || count(array_diff($oldAttendeeInstances, $newAttendeeInstances)) > 0 + || $oldEventInfo['significantChangeHash'] !== $eventInfo['significantChangeHash']; foreach ($attendee['newInstances'] as $instanceId => $instanceInfo) { $currentEvent = clone $eventInfo['instances'][$instanceId]; @@ -886,9 +886,9 @@ protected function parseEventInfo(VCalendar $calendar): array } if (isset($vevent->ATTENDEE)) { foreach ($vevent->ATTENDEE as $attendee) { - if ($this->scheduleAgentServerRules && - isset($attendee['SCHEDULE-AGENT']) && - 'CLIENT' === strtoupper($attendee['SCHEDULE-AGENT']->getValue()) + if ($this->scheduleAgentServerRules + && isset($attendee['SCHEDULE-AGENT']) + && 'CLIENT' === strtoupper($attendee['SCHEDULE-AGENT']->getValue()) ) { continue; } diff --git a/lib/Node.php b/lib/Node.php index 5ecc2c00..9ea14db9 100644 --- a/lib/Node.php +++ b/lib/Node.php @@ -178,8 +178,6 @@ public function offsetExists($offset): bool * This method just forwards the request to the inner iterator * * @param int $offset - * - * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($offset) @@ -194,8 +192,7 @@ public function offsetGet($offset) * * This method just forwards the request to the inner iterator * - * @param int $offset - * @param mixed $value + * @param int $offset */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void @@ -204,7 +201,7 @@ public function offsetSet($offset, $value): void $iterator->offsetSet($offset, $value); // @codeCoverageIgnoreStart - // + // // This method always throws an exception, so we ignore the closing // brace } @@ -225,7 +222,7 @@ public function offsetUnset($offset): void $iterator->offsetUnset($offset); // @codeCoverageIgnoreStart - // + // // This method always throws an exception, so we ignore the closing // brace } diff --git a/lib/Parser/MimeDir.php b/lib/Parser/MimeDir.php index 9a50ca0a..10bc3174 100644 --- a/lib/Parser/MimeDir.php +++ b/lib/Parser/MimeDir.php @@ -267,7 +267,7 @@ protected function parseLine(string $line) * * @return string * - *@throws EofException|ParseException + * @throws EofException|ParseException */ protected function readLine(): ?string { diff --git a/lib/Parser/Parser.php b/lib/Parser/Parser.php index d0bca8e4..29921d18 100644 --- a/lib/Parser/Parser.php +++ b/lib/Parser/Parser.php @@ -40,8 +40,7 @@ abstract class Parser * * Optionally, it's possible to parse the input stream here. * - * @param mixed $input - * @param int $options any parser options (OPTION constants) + * @param int $options any parser options (OPTION constants) */ public function __construct($input = null, int $options = 0) { diff --git a/lib/Parser/XML.php b/lib/Parser/XML.php index bb0b0cd3..9a510068 100644 --- a/lib/Parser/XML.php +++ b/lib/Parser/XML.php @@ -45,8 +45,7 @@ class XML extends Parser * * Optionally, it's possible to parse the input stream here. * - * @param mixed $input - * @param int $options any parser options (OPTION constants) + * @param int $options any parser options (OPTION constants) */ public function __construct($input = null, int $options = 0) { @@ -322,8 +321,6 @@ protected function parseComponent(Component $parentComponent): void /** * Create a property. * - * @param mixed $value - * * @throws InvalidDataException */ protected function createProperty(Component $parentComponent, string $name, array $parameters, string $type, $value): void diff --git a/lib/Property.php b/lib/Property.php index afc4a144..d887bfbb 100644 --- a/lib/Property.php +++ b/lib/Property.php @@ -42,8 +42,6 @@ abstract class Property extends Node /** * Current value. - * - * @var mixed */ protected $value; @@ -63,7 +61,7 @@ abstract class Property extends Node * @param array $parameters List of parameters * @param string|null $group The vcard property group */ - public function __construct(Component $root, ?string $name, $value = null, array $parameters = [], ?string $group = null) + public function __construct(Component $root, ?string $name, $value = null, array $parameters = [], string $group = null) { $this->name = $name; $this->group = $group; @@ -360,8 +358,6 @@ public function __toString(): string /** * Checks if an array element exists. - * - * @param mixed $offset */ #[\ReturnTypeWillChange] public function offsetExists($offset): bool @@ -407,7 +403,6 @@ public function offsetGet($offset): ?Node * Creates a new parameter. * * @param string|int $offset - * @param mixed $value */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value): void diff --git a/lib/Property/ICalendar/DateTime.php b/lib/Property/ICalendar/DateTime.php index 8c9e6704..7ee90797 100644 --- a/lib/Property/ICalendar/DateTime.php +++ b/lib/Property/ICalendar/DateTime.php @@ -108,10 +108,10 @@ public function hasTime(): bool public function isFloating(): bool { return - !$this->hasTime() || - ( - !isset($this['TZID']) && - false === strpos($this->getValue(), 'Z') + !$this->hasTime() + || ( + !isset($this['TZID']) + && false === strpos($this->getValue(), 'Z') ); } @@ -128,7 +128,7 @@ public function isFloating(): bool * * @throws InvalidDataException */ - public function getDateTime(?\DateTimeZone $timeZone = null): ?\DateTimeImmutable + public function getDateTime(\DateTimeZone $timeZone = null): ?\DateTimeImmutable { $dt = $this->getDateTimes($timeZone); if (!$dt) { @@ -149,7 +149,7 @@ public function getDateTime(?\DateTimeZone $timeZone = null): ?\DateTimeImmutabl * * @throws InvalidDataException */ - public function getDateTimes(?\DateTimeZone $timeZone = null): array + public function getDateTimes(\DateTimeZone $timeZone = null): array { // Does the property have a TZID? /** @var Property\FlatText $tzid */ @@ -299,7 +299,6 @@ function ($item) { * VALUE from DATE-TIME to DATE or vice-versa. * * @param string|int $offset - * @param mixed $value * * @throws InvalidDataException */ diff --git a/lib/Property/Uri.php b/lib/Property/Uri.php index 9816ffff..228b7090 100644 --- a/lib/Property/Uri.php +++ b/lib/Property/Uri.php @@ -3,7 +3,6 @@ namespace Sabre\VObject\Property; use Sabre\VObject\Parameter; -use Sabre\VObject\Property; /** * URI property. diff --git a/lib/Property/VCard/DateAndOrTime.php b/lib/Property/VCard/DateAndOrTime.php index e87bf1b3..9826bdbb 100644 --- a/lib/Property/VCard/DateAndOrTime.php +++ b/lib/Property/VCard/DateAndOrTime.php @@ -259,11 +259,11 @@ protected function xmlSerializeValue(Xml\Writer $writer): void $value .= '---'.$r('date'); } - // # 4.3.2 - // value-time = element time { - // xsd:string { pattern = "(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)" - // ~ "(Z|[+\-]\d\d(\d\d)?)?" } - // } + // # 4.3.2 + // value-time = element time { + // xsd:string { pattern = "(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)" + // ~ "(Z|[+\-]\d\d(\d\d)?)?" } + // } } elseif ((!$d('year') && !$d('month') && !$d('date')) && ($d('hour') || $d('minute') || $d('second'))) { if ($d('hour')) { @@ -276,11 +276,11 @@ protected function xmlSerializeValue(Xml\Writer $writer): void $value .= $r('timezone'); - // # 4.3.3 - // value-date-time = element date-time { - // xsd:string { pattern = "(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?" - // ~ "(Z|[+\-]\d\d(\d\d)?)?" } - // } + // # 4.3.3 + // value-date-time = element date-time { + // xsd:string { pattern = "(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?" + // ~ "(Z|[+\-]\d\d(\d\d)?)?" } + // } } elseif ($d('date') && $d('hour')) { if ($d('year') && $d('month') && $d('date')) { $value .= $r('year').$r('month').$r('date'); diff --git a/lib/Recur/EventIterator.php b/lib/Recur/EventIterator.php index ef72acb7..c08331f2 100644 --- a/lib/Recur/EventIterator.php +++ b/lib/Recur/EventIterator.php @@ -2,7 +2,6 @@ namespace Sabre\VObject\Recur; -use Iterator; use Sabre\VObject\Component; use Sabre\VObject\Component\VEvent; use Sabre\VObject\InvalidDataException; @@ -90,7 +89,7 @@ class EventIterator implements \Iterator * @throws NoInstancesException * @throws InvalidDataException */ - public function __construct($input, ?string $uid = null, \DateTimeZone $timeZone = null) + public function __construct($input, string $uid = null, \DateTimeZone $timeZone = null) { if (is_null($timeZone)) { $timeZone = new \DateTimeZone('UTC'); diff --git a/lib/Recur/MaxInstancesExceededException.php b/lib/Recur/MaxInstancesExceededException.php index 7889ce7e..38d62b46 100644 --- a/lib/Recur/MaxInstancesExceededException.php +++ b/lib/Recur/MaxInstancesExceededException.php @@ -2,8 +2,6 @@ namespace Sabre\VObject\Recur; -use Exception; - /** * This exception will get thrown when a recurrence rule generated more than * the maximum number of instances. diff --git a/lib/Recur/NoInstancesException.php b/lib/Recur/NoInstancesException.php index 8de7d11a..4c2d44aa 100644 --- a/lib/Recur/NoInstancesException.php +++ b/lib/Recur/NoInstancesException.php @@ -2,8 +2,6 @@ namespace Sabre\VObject\Recur; -use Exception; - /** * This exception gets thrown when a recurrence iterator produces 0 instances. * diff --git a/lib/Recur/RRuleIterator.php b/lib/Recur/RRuleIterator.php index 1d7cfcda..888556ee 100644 --- a/lib/Recur/RRuleIterator.php +++ b/lib/Recur/RRuleIterator.php @@ -2,7 +2,6 @@ namespace Sabre\VObject\Recur; -use DateTime; use DateTimeImmutable; use Iterator; use Sabre\VObject\DateTimeParser; @@ -338,9 +337,9 @@ protected function nextDaily(): void return; } } while ( - ($this->byDay && !in_array($currentDay, $recurrenceDays)) || - ($this->byHour && !in_array($currentHour, $recurrenceHours)) || - ($this->byMonth && !in_array($currentMonth, $recurrenceMonths)) + ($this->byDay && !in_array($currentDay, $recurrenceDays)) + || ($this->byHour && !in_array($currentHour, $recurrenceHours)) + || ($this->byMonth && !in_array($currentMonth, $recurrenceMonths)) ); } @@ -873,8 +872,8 @@ protected function getMonthlyOccurrences(): array if ($this->byMonthDay) { foreach ($this->byMonthDay as $monthDay) { // Removing values that are out of range for this month - if ($monthDay > $startDate->format('t') || - $monthDay < 0 - $startDate->format('t')) { + if ($monthDay > $startDate->format('t') + || $monthDay < 0 - $startDate->format('t')) { continue; } if ($monthDay > 0) { diff --git a/lib/TimeZoneUtil.php b/lib/TimeZoneUtil.php index 2cd45857..8c2a374f 100644 --- a/lib/TimeZoneUtil.php +++ b/lib/TimeZoneUtil.php @@ -72,7 +72,7 @@ private function addFinder(string $key, TimezoneFinder $finder): void * Alternatively, if $failIfUncertain is set to true, it will throw an * exception if we cannot accurately determine the timezone. */ - private function findTimeZone(string $tzid, ?Component $vcalendar = null, bool $failIfUncertain = false): \DateTimeZone + private function findTimeZone(string $tzid, Component $vcalendar = null, bool $failIfUncertain = false): \DateTimeZone { foreach ($this->timezoneFinders as $timezoneFinder) { $timezone = $timezoneFinder->find($tzid, $failIfUncertain); @@ -117,7 +117,7 @@ public static function addTimezoneFinder(string $key, TimezoneFinder $finder): v self::getInstance()->addFinder($key, $finder); } - public static function getTimeZone(string $tzid, ?Component $vcalendar = null, bool $failIfUncertain = false): \DateTimeZone + public static function getTimeZone(string $tzid, Component $vcalendar = null, bool $failIfUncertain = false): \DateTimeZone { return self::getInstance()->findTimeZone($tzid, $vcalendar, $failIfUncertain); } diff --git a/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php b/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php index f4949b35..ba84d45e 100644 --- a/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php +++ b/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php @@ -5,7 +5,6 @@ namespace Sabre\VObject\TimezoneGuesser; use DateTimeZone; -use Exception; /** * Some clients add 'X-LIC-LOCATION' with the olson name. @@ -41,9 +40,9 @@ public function find(string $tzid, ?bool $failIfUncertain = false): ?\DateTimeZo try { if ( - in_array($tzid, $tzIdentifiers) || - preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches) || - in_array($tzid, $this->getIdentifiersBC()) + in_array($tzid, $tzIdentifiers) + || preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches) + || in_array($tzid, $this->getIdentifiersBC()) ) { return new \DateTimeZone($tzid); } diff --git a/tests/VObject/Component/VCalendarTest.php b/tests/VObject/Component/VCalendarTest.php index bde6a4fa..1893a9ac 100644 --- a/tests/VObject/Component/VCalendarTest.php +++ b/tests/VObject/Component/VCalendarTest.php @@ -756,7 +756,7 @@ public function testCalDAVMETHOD(): void ); } - public function assertValidate($ics, $options, $expectedLevel, ?string $expectedMessage = null): void + public function assertValidate($ics, $options, $expectedLevel, string $expectedMessage = null): void { $vcal = VObject\Reader::read($ics); $result = $vcal->validate($options); @@ -764,7 +764,7 @@ public function assertValidate($ics, $options, $expectedLevel, ?string $expected self::assertValidateResult($result, $expectedLevel, $expectedMessage); } - public function assertValidateResult($input, $expectedLevel, ?string $expectedMessage = null): void + public function assertValidateResult($input, $expectedLevel, string $expectedMessage = null): void { $messages = []; foreach ($input as $warning) { diff --git a/tests/VObject/Component/VCardTest.php b/tests/VObject/Component/VCardTest.php index 3851d97d..b71b3085 100644 --- a/tests/VObject/Component/VCardTest.php +++ b/tests/VObject/Component/VCardTest.php @@ -283,7 +283,7 @@ public function testVCard21NoCardDAV(): void ); } - public function assertValidate($vcf, $options, int $expectedLevel, ?string $expectedMessage = null): void + public function assertValidate($vcf, $options, int $expectedLevel, string $expectedMessage = null): void { $vcal = VObject\Reader::read($vcf); $result = $vcal->validate($options); @@ -291,7 +291,7 @@ public function assertValidate($vcf, $options, int $expectedLevel, ?string $expe self::assertValidateResult($result, $expectedLevel, $expectedMessage); } - public function assertValidateResult($input, int $expectedLevel, ?string $expectedMessage = null): void + public function assertValidateResult($input, int $expectedLevel, string $expectedMessage = null): void { $messages = []; foreach ($input as $warning) { diff --git a/tests/VObject/FreeBusyGeneratorTest.php b/tests/VObject/FreeBusyGeneratorTest.php index e4715f63..47283eaf 100644 --- a/tests/VObject/FreeBusyGeneratorTest.php +++ b/tests/VObject/FreeBusyGeneratorTest.php @@ -46,7 +46,7 @@ public function testInvalidArg(): void * * @throws ParseException */ - public function assertFreeBusyReport(string $expected, $input, \DateTimeZone $timeZone = null, ?string $vavailability = null): void + public function assertFreeBusyReport(string $expected, $input, \DateTimeZone $timeZone = null, string $vavailability = null): void { $gen = new FreeBusyGenerator( new \DateTime('20110101T110000Z', new \DateTimeZone('UTC')),