Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecations warnings on PHP 8.1 #557

Merged
merged 2 commits into from
Dec 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Parser/MimeDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ protected function readProperty($line)
*
* Now for the parameters
*
* If delimiter is not set (null) this method will just return a string.
* If delimiter is not set (empty string) this method will just return a string.
* If it's a comma or a semi-colon the string will be split on those
* characters, and always return an array.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Property.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class Property extends Node
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = ';';

Expand Down
4 changes: 2 additions & 2 deletions lib/Property/Binary.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class Binary extends Property
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Updates the current value.
Expand Down
2 changes: 1 addition & 1 deletion lib/Property/FloatValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class FloatValue extends Property
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = ';';

Expand Down
4 changes: 2 additions & 2 deletions lib/Property/ICalendar/CalAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class CalAddress extends Text
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
2 changes: 1 addition & 1 deletion lib/Property/ICalendar/Duration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Duration extends Property
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = ',';

Expand Down
2 changes: 1 addition & 1 deletion lib/Property/ICalendar/Period.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Period extends Property
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = ',';

Expand Down
4 changes: 2 additions & 2 deletions lib/Property/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class Time extends Text
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
4 changes: 2 additions & 2 deletions lib/Property/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class Uri extends Text
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
4 changes: 2 additions & 2 deletions lib/Property/UtcOffset.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ class UtcOffset extends Text
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
4 changes: 2 additions & 2 deletions lib/Property/VCard/DateAndOrTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class DateAndOrTime extends Property
/**
* Field separator.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
4 changes: 2 additions & 2 deletions lib/Property/VCard/TimeStamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class TimeStamp extends Text
* In case this is a multi-value property. This string will be used as a
* delimiter.
*
* @var string|null
* @var string
*/
public $delimiter = null;
public $delimiter = '';

/**
* Returns the type of value.
Expand Down
9 changes: 9 additions & 0 deletions lib/Recur/EventIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public function __construct($input, $uid = null, DateTimeZone $timeZone = null)
*
* @return DateTimeImmutable
*/
#[\ReturnTypeWillChange]
public function current()
{
if ($this->currentDate) {
Expand Down Expand Up @@ -285,6 +286,7 @@ public function getEventObject()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
// The counter is always 1 ahead.
Expand All @@ -297,6 +299,7 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
if ($this->counter > Settings::$maxRecurrences && -1 !== Settings::$maxRecurrences) {
Expand All @@ -308,7 +311,10 @@ public function valid()

/**
* Sets the iterator back to the starting point.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->recurIterator->rewind();
Expand All @@ -331,7 +337,10 @@ public function rewind()

/**
* Advances the iterator with one step.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
$this->currentOverriddenEvent = null;
Expand Down
9 changes: 9 additions & 0 deletions lib/Recur/RDateIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public function __construct($rrule, DateTimeInterface $start)

/* Implementation of the Iterator interface {{{ */

#[\ReturnTypeWillChange]
public function current()
{
if (!$this->valid()) {
Expand All @@ -49,6 +50,7 @@ public function current()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->counter;
Expand All @@ -60,14 +62,18 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
return $this->counter <= count($this->dates);
}

/**
* Resets the iterator.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentDate = clone $this->startDate;
Expand All @@ -76,7 +82,10 @@ public function rewind()

/**
* Goes on to the next iteration.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
++$this->counter;
Expand Down
9 changes: 9 additions & 0 deletions lib/Recur/RRuleIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function __construct($rrule, DateTimeInterface $start)

/* Implementation of the Iterator interface {{{ */

#[\ReturnTypeWillChange]
public function current()
{
if (!$this->valid()) {
Expand All @@ -52,6 +53,7 @@ public function current()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->counter;
Expand All @@ -64,6 +66,7 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
if (null === $this->currentDate) {
Expand All @@ -78,7 +81,10 @@ public function valid()

/**
* Resets the iterator.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentDate = clone $this->startDate;
Expand All @@ -87,7 +93,10 @@ public function rewind()

/**
* Goes on to the next iteration.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function next()
{
// Otherwise, we find the next event in the normal RRULE
Expand Down