Skip to content

Commit

Permalink
Merge upstream commits (#36)
Browse files Browse the repository at this point in the history
* fix  Bad file descriptor (7.4) (sabre-io#469)

* travis: allow failure for phpstan for now (sabre-io#470)

* travis: add php 7.4snapshot build (sabre-io#471)

* reduce phpstan level back to 0, as level 1 is failing right now (sabre-io#472)

* reduce phpstan level back to 0, as level 1 is failing right now

* travis: no longer allow failures for phpstan

* Fixed typo in vobject CLI help (sabre-io#477)

* Release 4.2.1 (sabre-io#479)

* Release 4.2.1

* Update CHANGELOG.md

* Prepare next iteration (sabre-io#480)

* Run phpstan on PHP >= 7.1 (sabre-io#483)

* Add TZ in iTip REPLY messages

* Added phpstan for tests folder (sabre-io#485)

* Add PHONE-NUMBER value type (used for TEL in vCard 3.0) (sabre-io#486)

Signed-off-by: Christian Kraus <hanzi@hanzi.cc>

* use latest phpstan 0.12.5 in CI

* Add PHPstorm .idea to .gitignore

* Fix various typos

* Release 4.2.2 (sabre-io#490)

* Release 4.2.2

* Update CHANGELOG.md

* Prepare next iteration

* Update dependencies and code style tools

* Remove unneeded 'bootstrap' line from phpstan.neon

* Apply php-cs-fixer code style changes

* run php-cs-fixer in CI

* php-cs-fixer must be at least 2.16.1 for PHP 7.4

* Use phpunit8 where possible

* Fixed phpstan level 1 errors

* Make sure there is no logic change

* Prevent setting foreach key beforehand

* Refactored fqcn strings to ::class to allow checking with phpstan (sabre-io#495)

* Release 4.3.0 (sabre-io#497)

* Update CHANGELOG.md

* Update Version.php

* Added phpstan to dev dependencies

* Reset bin-dir config

* Added convenient development commands

* Cleaned up .gitignore
These entries should be in the developer's global .gitignore

* cs-fixer: don't check only the lib folder

* Decoupled cs-fixer command from chosen tool

* Standardize CI

* Use phpunit 9 where possible

* Only upload coverage when it has been collected

* Replace assertRegExp with assertMatchesRegularExpression in unit test

* fix an incomplete phpdoc type annotation

* Release 4.3.1

* Adjust boolean vars in .travis.yml to prepare for PHP8.0

* Run unit tests on PHP8

* Fixup calendar parameter to Broker parseEvent

* Release 4.3.2

* Remove Pacific-New obsolete timezone

* Do composer remove --no-update in Travis

* Use min php-cs-fixer 2.16.7

* Release 4.3.3

* Add .gitattributes

* Explicitly select PHP 8.0 in CI

* Use latest php-cs-fixer 2.17.1

* Update windowszones timezone data to 2020-12-13

* Fix typos

* Reassign modified date in yearly rrule

* Add test

* Code style

* Add test for calendar expand

* adjust unit test settings for time limits

Some tests were testing a bug that caused an infinite loop.

Annotate those tests with large, small annotations.

Turn on enforceTimeLimit, failOnWarning and failOnRisky so that the
annotations are enforced when unit tests are run.

Add phpunit/php-invoker to the composer require-dev becaause this is
required to make the enforceTimeLimit setting effective.

* Release 4.3.4

* Make use of until parameter in nextMonthly function

* CS FIX

* CS FIX

* Fix breaking tests

* create testMonthlyByDayUntil

* create testMonthlyByDayUntilWithImpossibleNextOccurrence

* Fix setting properties with group assignment

* Unit test for adding properties with group for a VCard

* Adapt style

* Release 4.3.5

* tests: migrate from Travis to gh-actions

* Removed travis config

* Minor edit to README

* Run phpunit with coverage in CI

* Fix deprecated usages and return types on PHP 8.1

* sync ci.yml to match other repos

* Changes that should have happened for 4.3.6

* changelog and VERSION bump for 4.3.7

* EventIterator returns wrong endTime (sabre-io#534)

* Reordering of the attendees should not be a signitifcant change (sabre-io#540)

* Reordering of vevent should not be a significant change (sabre-io#542)

* Prepare release 4.3.8

* Allow easier extension of the timezone guessing

This will ease customization of timezone-guessing as it is now gets easier
to extend that process with own implementations (as long as they
implement the appropriate interface)

This is espechially necessary when wanting to actually guess a timezone
via the rules defined in the VTIMEZONE-entry (which is currently not
done)

* testEmptyTimeZone

* Changelog for 4.4.0

* Fix Iterator method signatures

This avoids warnings under PHP>=8.1
Real return types should be added before PHP 9

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

* Avoid passing null as separator for implode

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>

* Prepare release 4.4.1

* Rebase fix

* Add PHP8.1 CI

* Remove PHPUnit update

* Fix PHP8.1 tests

Co-authored-by: Remi Collet <remi@remirepo.net>
Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
Co-authored-by: Dominik <dominik@tobschall.de>
Co-authored-by: Jeroen van Oort <jvanoort@simplexis.nl>
Co-authored-by: Renaud BOYER <rboyer@linagora.com>
Co-authored-by: Christian Kraus <github@hanzi.cc>
Co-authored-by: Thomas Müller <thomas.mueller@tmit.eu>
Co-authored-by: Phil Davis <phil@jankaritech.com>
Co-authored-by: Michael Stilkerich <ms@mike2k.de>
Co-authored-by: Stéphane <demonchaux.stephane@gmail.com>
Co-authored-by: Allon Moritz <allon.moritz@digital-peak.com>
Co-authored-by: Jair Cueva Junior <junior@dinhost.com.br>
Co-authored-by: Parajuli Kiran <kiranparajuli589@gmail.com>
Co-authored-by: Cédric Anne <cedric.anne@gmail.com>
Co-authored-by: Holger Floerke <floerke@doctronic.de>
Co-authored-by: Andreas Heigl <andreas@heigl.org>
Co-authored-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
18 people committed Dec 15, 2021
1 parent 4d357a6 commit 814f4b8
Show file tree
Hide file tree
Showing 26 changed files with 185 additions and 272 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/actions.yml
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0']
php-versions: ['7.4', '8.0', '8.1']

runs-on: ${{ matrix.operating-system }}

Expand Down
18 changes: 0 additions & 18 deletions .gitignore
Expand Up @@ -5,23 +5,5 @@ tests/cov/
tests/temp
tests/.phpunit.result.cache

#vim
.*.swp

#binaries
bin/phpunit
bin/phpcs
bin/php-cs-fixer
bin/sabre-cs-fixer
bin/hoa

# Development stuff
.php_cs.cache
.idea

# OS X
.DS_Store
=======

# Development stuff
.php_cs.cache
3 changes: 1 addition & 2 deletions .php_cs.dist
Expand Up @@ -6,8 +6,7 @@ $config->getFinder()
->in(__DIR__);
$config->setRules([
'@PSR1' => true,
'@Symfony' => true,
'phpdoc_summary' => false
'@Symfony' => true
]);

return $config;
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/Parser/MimeDir.php
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
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
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
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
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
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
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
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
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
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
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
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
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
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
17 changes: 16 additions & 1 deletion lib/Recur/RRuleIterator.php
Expand Up @@ -37,6 +37,7 @@ public function __construct($rrule, DateTimeInterface $start)

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

#[\ReturnTypeWillChange]
public function current()
{
if (!$this->valid()) {
Expand All @@ -51,6 +52,7 @@ public function current()
*
* @return int
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->counter;
Expand All @@ -63,6 +65,7 @@ public function key()
*
* @return bool
*/
#[\ReturnTypeWillChange]
public function valid()
{
if (null === $this->currentDate) {
Expand All @@ -77,7 +80,10 @@ public function valid()

/**
* Resets the iterator.
*
* @return void
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->currentDate = clone $this->startDate;
Expand All @@ -88,8 +94,10 @@ public function rewind()
* Goes on to the next iteration.
*
* @param int $amount
* @return void
*/
public function next($amount = 1)
#[\ReturnTypeWillChange]
public function next(int $amount = 1)
{
// Otherwise, we find the next event in the normal RRULE
// sequence.
Expand Down Expand Up @@ -640,6 +648,9 @@ protected function nextMonthly($amount = 1)
// This goes to 0 because we need to start counting at the
// beginning.
$currentDayOfMonth = 0;

// For some reason the "until" parameter was not being used here,
// that's why the workaround of the 10000 year bug was needed at all
$currentHourOfMonth = 0;
$currentMinuteOfMonth = 0;
$currentSecondOfMonth = 0;
Expand All @@ -650,6 +661,10 @@ protected function nextMonthly($amount = 1)
if ($this->until && $this->currentDate->getTimestamp() >= $this->until->getTimestamp()) {
return;
}
// let's stop it before the "until" parameter date
if ($this->until && $this->currentDate->getTimestamp() >= $this->until->getTimestamp()) {
return;
}

// To prevent running this forever (better: until we hit the max date of DateTimeImmutable) we simply
// stop at 9999-12-31. Looks like the year 10000 problem is not solved in php ....
Expand Down

0 comments on commit 814f4b8

Please sign in to comment.