Skip to content

Commit 0795cd7

Browse files
committed
Fix Implicitly marking parameter $param as nullable is deprecated
1 parent 7148cf5 commit 0795cd7

9 files changed

+18
-18
lines changed

lib/Component/VCalendar.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ public function getBaseComponent($componentName = null)
281281
*
282282
* @return VCalendar
283283
*/
284-
public function expand(DateTimeInterface $start, DateTimeInterface $end, DateTimeZone $timeZone = null)
284+
public function expand(DateTimeInterface $start, DateTimeInterface $end, ?DateTimeZone $timeZone = null)
285285
{
286286
$newChildren = [];
287287
$recurringEvents = [];

lib/DateTimeParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class DateTimeParser
3131
*
3232
* @return DateTimeImmutable
3333
*/
34-
public static function parseDateTime($dt, DateTimeZone $tz = null)
34+
public static function parseDateTime($dt, ?DateTimeZone $tz = null)
3535
{
3636
// Format is YYYYMMDD + "T" + hhmmss
3737
$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);
@@ -61,7 +61,7 @@ public static function parseDateTime($dt, DateTimeZone $tz = null)
6161
*
6262
* @return DateTimeImmutable
6363
*/
64-
public static function parseDate($date, DateTimeZone $tz = null)
64+
public static function parseDate($date, ?DateTimeZone $tz = null)
6565
{
6666
// Format is YYYYMMDD
6767
$result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/', $date, $matches);

lib/Document.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function create($name)
157157
*
158158
* @return Component
159159
*/
160-
public function createComponent($name, array $children = null, $defaults = true)
160+
public function createComponent($name, ?array $children = null, $defaults = true)
161161
{
162162
$name = strtoupper($name);
163163
$class = Component::class;
@@ -187,7 +187,7 @@ public function createComponent($name, array $children = null, $defaults = true)
187187
* @param array $parameters
188188
* @param string $valueType Force a specific valuetype, such as URI or TEXT
189189
*/
190-
public function createProperty($name, $value = null, array $parameters = null, $valueType = null, int $lineIndex = null, string $lineString = null): Property
190+
public function createProperty($name, $value = null, ?array $parameters = null, $valueType = null, ?int $lineIndex = null, ?string $lineString = null): Property
191191
{
192192
// If there's a . in the name, it means it's prefixed by a groupname.
193193
if (false !== ($i = strpos($name, '.'))) {

lib/FreeBusyGenerator.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class FreeBusyGenerator
8989
* @param mixed $objects
9090
* @param DateTimeZone $timeZone
9191
*/
92-
public function __construct(DateTimeInterface $start = null, DateTimeInterface $end = null, $objects = null, DateTimeZone $timeZone = null)
92+
public function __construct(?DateTimeInterface $start = null, ?DateTimeInterface $end = null, $objects = null, ?DateTimeZone $timeZone = null)
9393
{
9494
$this->setTimeRange($start, $end);
9595

@@ -158,7 +158,7 @@ public function setObjects($objects)
158158
* @param DateTimeInterface $start
159159
* @param DateTimeInterface $end
160160
*/
161-
public function setTimeRange(DateTimeInterface $start = null, DateTimeInterface $end = null)
161+
public function setTimeRange(?DateTimeInterface $start = null, ?DateTimeInterface $end = null)
162162
{
163163
if (!$start) {
164164
$start = new DateTimeImmutable(Settings::$minDate);

lib/ITip/Broker.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class Broker
108108
*
109109
* @return VCalendar|null
110110
*/
111-
public function processMessage(Message $itipMessage, VCalendar $existingObject = null)
111+
public function processMessage(Message $itipMessage, ?VCalendar $existingObject = null)
112112
{
113113
// We only support events at the moment.
114114
if ('VEVENT' !== $itipMessage->component) {
@@ -266,7 +266,7 @@ public function parseEvent($calendar, $userHref, $oldCalendar = null)
266266
*
267267
* @return VCalendar|null
268268
*/
269-
protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null)
269+
protected function processMessageRequest(Message $itipMessage, ?VCalendar $existingObject = null)
270270
{
271271
if (!$existingObject) {
272272
// This is a new invite, and we're just going to copy over
@@ -301,7 +301,7 @@ protected function processMessageRequest(Message $itipMessage, VCalendar $existi
301301
*
302302
* @return VCalendar|null
303303
*/
304-
protected function processMessageCancel(Message $itipMessage, VCalendar $existingObject = null)
304+
protected function processMessageCancel(Message $itipMessage, ?VCalendar $existingObject = null)
305305
{
306306
if (!$existingObject) {
307307
// The event didn't exist in the first place, so we're just
@@ -326,7 +326,7 @@ protected function processMessageCancel(Message $itipMessage, VCalendar $existin
326326
*
327327
* @return VCalendar|null
328328
*/
329-
protected function processMessageReply(Message $itipMessage, VCalendar $existingObject = null)
329+
protected function processMessageReply(Message $itipMessage, ?VCalendar $existingObject = null)
330330
{
331331
// A reply can only be processed based on an existing object.
332332
// If the object is not available, the reply is ignored.
@@ -807,7 +807,7 @@ protected function parseEventForAttendee(VCalendar $calendar, array $eventInfo,
807807
*
808808
* @return array
809809
*/
810-
protected function parseEventInfo(VCalendar $calendar = null)
810+
protected function parseEventInfo(?VCalendar $calendar = null)
811811
{
812812
$uid = null;
813813
$organizer = null;

lib/Property.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ abstract class Property extends Node
8181
* @param array $parameters List of parameters
8282
* @param string $group The vcard property group
8383
*/
84-
public function __construct(Component $root, $name, $value = null, array $parameters = [], $group = null, int $lineIndex = null, string $lineString = null)
84+
public function __construct(Component $root, $name, $value = null, array $parameters = [], $group = null, ?int $lineIndex = null, ?string $lineString = null)
8585
{
8686
$this->name = $name;
8787
$this->group = $group;

lib/Property/ICalendar/DateTime.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function isFloating()
131131
*
132132
* @return \DateTimeImmutable
133133
*/
134-
public function getDateTime(DateTimeZone $timeZone = null)
134+
public function getDateTime(?DateTimeZone $timeZone = null)
135135
{
136136
$dt = $this->getDateTimes($timeZone);
137137
if (!$dt) {
@@ -153,7 +153,7 @@ public function getDateTime(DateTimeZone $timeZone = null)
153153
* @return \DateTimeImmutable[]
154154
* @return \DateTime[]
155155
*/
156-
public function getDateTimes(DateTimeZone $timeZone = null)
156+
public function getDateTimes(?DateTimeZone $timeZone = null)
157157
{
158158
// Does the property have a TZID?
159159
$tzid = $this['TZID'];

lib/Recur/EventIterator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class EventIterator implements \Iterator
9393
* @param DateTimeZone $timeZone reference timezone for floating dates and
9494
* times
9595
*/
96-
public function __construct($input, $uid = null, DateTimeZone $timeZone = null)
96+
public function __construct($input, $uid = null, ?DateTimeZone $timeZone = null)
9797
{
9898
if (is_null($timeZone)) {
9999
$timeZone = new DateTimeZone('UTC');

lib/TimeZoneUtil.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private function addFinder(string $key, TimezoneFinder $finder): void
7575
* Alternatively, if $failIfUncertain is set to true, it will throw an
7676
* exception if we cannot accurately determine the timezone.
7777
*/
78-
private function findTimeZone(string $tzid, Component $vcalendar = null, bool $failIfUncertain = false): DateTimeZone
78+
private function findTimeZone(string $tzid, ?Component $vcalendar = null, bool $failIfUncertain = false): DateTimeZone
7979
{
8080
foreach ($this->timezoneFinders as $timezoneFinder) {
8181
$timezone = $timezoneFinder->find($tzid, $failIfUncertain);
@@ -126,7 +126,7 @@ public static function addTimezoneFinder(string $key, TimezoneFinder $finder): v
126126
*
127127
* @return DateTimeZone
128128
*/
129-
public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false)
129+
public static function getTimeZone($tzid, ?Component $vcalendar = null, $failIfUncertain = false)
130130
{
131131
return self::getInstance()->findTimeZone($tzid, $vcalendar, $failIfUncertain);
132132
}

0 commit comments

Comments
 (0)