Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into merge_upstream_co…
Browse files Browse the repository at this point in the history
…mmits
  • Loading branch information
giuseppe-arcuti committed Nov 25, 2021
2 parents c26e2d4 + 0a2e27c commit 3194a82
Show file tree
Hide file tree
Showing 55 changed files with 1,100 additions and 172 deletions.
7 changes: 7 additions & 0 deletions .gitattributes
@@ -0,0 +1,7 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php_cs.dist export-ignore
/.travis.yml export-ignore
/CHANGELOG.md export-ignore
/phpstan.neon export-ignore
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,63 @@
name: continuous-integration
on:
push:
branches:
- master
- release/*
pull_request:
jobs:
unit-testing:
name: PHPUnit (PHP ${{ matrix.php-versions }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
coverage: ['pcov']
code-analysis: ['no']
include:
- php-versions: '7.1'
coverage: 'none'
code-analysis: 'yes'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, mysql, redis, opcache
coverage: ${{ matrix.coverage }}
tools: composer

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader

- name: Code Analysis (PHP CS-Fixer)
if: matrix.code-analysis == 'yes'
run: php vendor/bin/php-cs-fixer fix --dry-run --diff

- name: Code Analysis (PHPStan)
if: matrix.code-analysis == 'yes'
run: composer phpstan

- name: Test with phpunit
run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml

- name: Code Coverage
uses: codecov/codecov-action@v2
if: matrix.coverage != 'none'
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -21,3 +21,7 @@ bin/hoa

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

# Development stuff
.php_cs.cache
83 changes: 79 additions & 4 deletions CHANGELOG.md
Expand Up @@ -54,6 +54,81 @@ ChangeLog
* #2 Fix bug in by year day
* #3 Add daily occurrences to nextMonth and NextYear
* #4 Enhance fast forward speed if no count value has been given
=======
4.4.0 (2021-11-15)
------------------

#548: Allow easier extension of the timezone guessing (@heiglandreas)

4.3.8 (2021-11-14)
------------------

* #538: fix EventIterator returns wrong end endTime (@floerke)
* #541: Reordering of the attendees is not a significant change (@floerke)
* #543: Reordering of vevent is not a significant change (@floerke)

4.3.7 (2021-11-04)
------------------

* #551: version bump that was missed in 4.3.6 (@phil-davis)

4.3.6 (2021-11-04)
------------------

* #544: Fix deprecated usages and return types on PHP 8.1 (@cedric-anne)

4.3.5 (2021-02-12)
------------------

* #523: Fix setting properties with group assignment (@mstilkerich)
* #532: Make use of until parameter in nextMonthly function (@jaircuevajunior)

4.3.4 (2021-02-04)
------------------

* #529: Reassign modified date in yearly rrule (@laoneo)
* #525: Add .gitattributes to reduce package size (@fezfez)

4.3.3 (2020-11-09)
------------------

* #519: Remove US/Pacific-New obsolete timezone (@phil-davis)

4.3.2 (2020-10-03)
------------------

* #513: Added Support for PHP 8.0 (@phil-davis)

4.3.1 (2020-07-13)
------------------

* #510: Fix an incomplete phpdoc type annotation (@mstilkerich)
* #505: Refactor unit test code for phpunit9 (@phil-davis)
* #500: Standardize CI (@phil-davis)
* #496: CI tooling changes (@JeroenVanOort)

4.3.0 (2020-01-31)
------------------

* Added support for PHP 7.4, dropped support for PHP 7.0 (@phil-davis)
* #487: Added phpstan coverage, updated testsuite for phpunit8 (@phil-davis, @JeroenVanOort)
* #495: refactored maps to use ::class notation (@JeroenVanOort)

4.2.2 (2020-01-14)
------------------

* #465: Add TZ in iTip REPLY iTip messages
* #486: Add PHONE-NUMBER value type (used for TEL in vCard 3.0)

4.2.1 (2019-12-18)
------------------

* #469, #451: fix compat with php 7.4
* #443: prevent running in indefinite loop
* #449: Preventing creating a component for a root document
* #450: Fix parse with option Forgiving with trailing equal
* #459: fixed typo in VCalendar which resulting in usage of the wrong TimeZone
* #462: Broker::parseEventForOrganizer copies DTSTAMP from $eventInfo that causes broken scheduling

4.2.0 (2019-02-19)
------------------
Expand Down Expand Up @@ -138,7 +213,7 @@ ChangeLog
* #306: iTip REPLYs to the first instance of a recurring event was not handled
correctly.
* Slightly better error message during validation of `N` and `ADR` properties.
* #312: Correctly extracing timezone in the iTip broker, even when we don't
* #312: Correctly extracting timezone in the iTip broker, even when we don't
have a master event. (@vkomrakov-sugar).
* When validating a component's property that must appear once and which could
automatically be repaired, make sure we report the change as 'repaired'.
Expand Down Expand Up @@ -460,7 +535,7 @@ ChangeLog
* #114: VTIMEZONE is retained when generating new REQUEST objects.
* #114: Support for 'MAILTO:' style email addresses (in uppercase) in the iTip
broker. This improves evolution support.
* #115: Using REQUEST-STATUS from REPLY messages and now propegating that into
* #115: Using REQUEST-STATUS from REPLY messages and now propagating that into
SCHEDULE-STATUS.


Expand Down Expand Up @@ -697,7 +772,7 @@ ChangeLog
3.0.0-alpha2 (2013-05-22)
-------------------------

* Fixed: vCard URL properties were referencing a non-existant class.
* Fixed: vCard URL properties were referencing a non-existent class.


3.0.0-alpha1 (2013-05-21)
Expand Down Expand Up @@ -855,7 +930,7 @@ ChangeLog
properties such as N, ADR, ORG and CATEGORIES.
* Added: Splitter classes, that can split up large objects (such as exports)
into individual objects (thanks @DominikTo and @armin-hackmann).
* Added: VFREEBUSY component, which allows easily checking wether timeslots are
* Added: VFREEBUSY component, which allows easily checking whether timeslots are
available.
* Added: The Reader class now has a 'FORGIVING' option, which allows it to parse
properties with incorrect characters in the name (at this time, it just allows
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -7,7 +7,7 @@ sabre/vobject
The VObject library allows you to easily parse and manipulate [iCalendar](https://tools.ietf.org/html/rfc5545)
and [vCard](https://tools.ietf.org/html/rfc6350) objects using PHP.

The goal of the VObject library is to create a very complete library, with an easy to use API.
The goal of the VObject library is to create a very complete library, with an easy-to-use API.


Installation
Expand Down
2 changes: 1 addition & 1 deletion bin/bench_freebusygenerator.php
Expand Up @@ -11,7 +11,7 @@
echo "The process will be repeated 100 times to get accurate stats\n";
echo "\n";
echo 'Usage: '.$argv[0]." inputfile.ics\n";
die();
exit();
}

list(, $inputFile) = $argv;
Expand Down
2 changes: 1 addition & 1 deletion bin/bench_manipulatevcard.php
Expand Up @@ -10,7 +10,7 @@
echo 'system.';
echo "\n";
echo 'Usage: '.$argv[0]." inputfile.vcf\n";
die();
exit();
}

list(, $inputFile) = $argv;
Expand Down
5 changes: 2 additions & 3 deletions bin/fetch_windows_zones.php
@@ -1,13 +1,12 @@
#!/usr/bin/env php
<?php

$windowsZonesUrl = 'http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml';
$windowsZonesUrl = 'https://raw.githubusercontent.com/unicode-org/cldr/master/common/supplemental/windowsZones.xml';
$outputFile = __DIR__.'/../lib/timezonedata/windowszones.php';

echo 'Fetching timezone map from: '.$windowsZonesUrl, "\n";

$data = file_get_contents($windowsZonesUrl);

$xml = simplexml_load_string($data);

$map = [];
Expand Down Expand Up @@ -44,6 +43,6 @@

echo "Formatting\n";

exec(__DIR__.'/sabre-cs-fixer fix '.escapeshellarg($outputFile));
exec(__DIR__.'/../vendor/bin/php-cs-fixer fix '.escapeshellarg($outputFile));

echo "Done\n";
4 changes: 2 additions & 2 deletions bin/generateicalendardata.php
Expand Up @@ -18,7 +18,7 @@
HI
);
die();
exit();
}

$events = 100;
Expand Down Expand Up @@ -77,7 +77,7 @@
if ($result) {
fwrite(STDERR, "Errors!\n");
fwrite(STDERR, print_r($result, true));
die(-1);
exit(-1);
}

fwrite(STDERR, "Serializing this beast\n");
Expand Down
4 changes: 2 additions & 2 deletions bin/mergeduplicates.php
Expand Up @@ -19,15 +19,15 @@

if (!class_exists('Sabre\\VObject\\Version')) {
fwrite(STDERR, "Composer autoloader could not be loaded.\n");
die(1);
exit(1);
}

echo 'sabre/vobject ', Version::VERSION, " duplicate contact merge tool\n";

if ($argc < 3) {
echo "\n";
echo 'Usage: ', $argv[0], " input.vcf output.vcf [debug.log]\n";
die(1);
exit(1);
}

$input = fopen($argv[1], 'r');
Expand Down
2 changes: 1 addition & 1 deletion bin/rrulebench.php
Expand Up @@ -9,7 +9,7 @@
echo 'system.';
echo "\n";
echo 'Usage: '.$argv[0]." inputfile.ics startdate enddate\n";
die();
exit();
}

list(, $inputFile, $startDate, $endDate) = $argv;
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -37,8 +37,9 @@
"sabre/xml" : "^2.1"
},
"require-dev" : {
"friendsofphp/php-cs-fixer": "~2.16.7",
"friendsofphp/php-cs-fixer": "~2.17.1",
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0",
"phpunit/php-invoker" : "^2.0 || ^3.1",
"phpstan/phpstan": "^0.12"
},
"suggest" : {
Expand Down
11 changes: 2 additions & 9 deletions lib/Cli.php
Expand Up @@ -2,8 +2,7 @@

namespace Sabre\VObject;

use
InvalidArgumentException;
use InvalidArgumentException;

/**
* This is the CLI interface for sabre-vobject.
Expand Down Expand Up @@ -137,17 +136,14 @@ public function main(array $argv)
// jcard/jcal documents
case 'jcard':
case 'jcal':

// specific document versions
case 'vcard21':
case 'vcard30':
case 'vcard40':
case 'icalendar20':

// specific formats
case 'json':
case 'mimedir':

// icalendar/vcad
case 'icalendar':
case 'vcard':
Expand Down Expand Up @@ -183,7 +179,6 @@ public function main(array $argv)
case 'vcard30':
case 'vcard40':
case 'icalendar20':

$this->inputFormat = 'mimedir';
break;

Expand Down Expand Up @@ -211,7 +206,7 @@ public function main(array $argv)
}

if (!in_array($positional[0], ['validate', 'repair', 'convert', 'color'])) {
throw new InvalidArgumentException('Uknown command: '.$positional[0]);
throw new InvalidArgumentException('Unknown command: '.$positional[0]);
}
} catch (InvalidArgumentException $e) {
$this->showHelp();
Expand Down Expand Up @@ -458,8 +453,6 @@ protected function convert($vObj)
* Colorizes a file.
*
* @param Component $vObj
*
* @return int
*/
protected function color($vObj)
{
Expand Down
5 changes: 3 additions & 2 deletions lib/Component.php
Expand Up @@ -160,9 +160,9 @@ public function remove($item)
return;
}
}
}

throw new \InvalidArgumentException('The item you passed to remove() was not a child of this component');
throw new \InvalidArgumentException('The item you passed to remove() was not a child of this component');
}
}

/**
Expand Down Expand Up @@ -339,6 +339,7 @@ function ($a, $b) use ($sortScore, $tmp) {
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$components = [];
Expand Down
2 changes: 1 addition & 1 deletion lib/Component/VCalendar.php
Expand Up @@ -309,7 +309,7 @@ public function expand(DateTimeInterface $start, DateTimeInterface $end, DateTim

foreach ($this->children() as $child) {
if ($child instanceof Property && 'PRODID' !== $child->name) {
// We explictly want to ignore PRODID, because we want to
// We explicitly want to ignore PRODID, because we want to
// overwrite it with our own.
$newChildren[] = clone $child;
} elseif ($child instanceof Component && 'VTIMEZONE' !== $child->name) {
Expand Down

0 comments on commit 3194a82

Please sign in to comment.