Skip to content

Commit

Permalink
Merge upstream (#16)
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)

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

* 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

* Prepare next iteration

* Apply php-cs-fixer code style changes

* 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)

* Added convenient development commands

* Decoupled cs-fixer command from chosen tool

* Use phpunit 9 where possible

* Replace assertRegExp with assertMatchesRegularExpression in unit test

* fix an incomplete phpdoc type annotation

* php-cs-fixer fixes

* Ignore phpdoc_summary check

Seriously you want me to put a full stop directly after a link??

* Drop php < 7.1, pull composer / travis changes

from upstream

* Release 4.3.4

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: Phil Davis <phil@jankaritech.com>
Co-authored-by: Michael Stilkerich <ms@mike2k.de>
  • Loading branch information
9 people committed Jul 28, 2020
1 parent b16c3e7 commit 10a03a8
Show file tree
Hide file tree
Showing 109 changed files with 894 additions and 742 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,7 @@ vendor/
composer.lock
tests/cov/
tests/temp
tests/.phpunit.result.cache

#vim
.*.swp
Expand All @@ -17,6 +18,7 @@ bin/hoa
# Development stuff
testdata/
.php_cs.cache
.idea

# OS X
.DS_Store
5 changes: 3 additions & 2 deletions .php_cs.dist
Expand Up @@ -6,7 +6,8 @@ $config->getFinder()
->in(__DIR__);
$config->setRules([
'@PSR1' => true,
'@Symfony' =>true
'@Symfony' => true,
'phpdoc_summary' => false
]);

return $config;
return $config;
29 changes: 14 additions & 15 deletions .travis.yml
@@ -1,38 +1,37 @@
language: php
sudo: required
php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4

env:
global:
- MEMCACHED_SERVER=127.0.0.1
- RUN_PHPSTAN="FALSE"
matrix:
- PREFER_LOWEST="" REPORT_COVERAGE="TRUE" WITH_COVERAGE="--coverage-clover=coverage.xml"
- PREFER_LOWEST="--prefer-lowest" REPORT_COVERAGE="FALSE" WITH_COVERAGE=""

matrix:
include:
- name: 'PHPStan'
php: 7.2
env: RUN_PHPSTAN="TRUE"
php: 7.4
env:
- RUN_PHPSTAN="TRUE"
- REPORT_COVERAGE="FALSE"
fast_finish: true
allow_failures:
- php: 5.5

install:
- if [ $RUN_PHPSTAN == "TRUE" ]; then wget https://github.com/phpstan/phpstan/releases/download/0.11.8/phpstan.phar; fi

before_script:
- composer install
- composer update $PREFER_LOWEST

script:
- if [ $RUN_PHPSTAN == "FALSE" ]; then ./bin/phpunit --configuration tests/phpunit.xml --coverage-clover=coverage.xml; fi
- if [ $RUN_PHPSTAN == "TRUE" ]; then php phpstan.phar analyse -c phpstan.neon lib; fi
- if [ $RUN_PHPSTAN == "FALSE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi
- if [ $RUN_PHPSTAN == "FALSE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE; fi
- if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi

after_success:
- bash <(curl -s https://codecov.io/bash)
- if [ $REPORT_COVERAGE == "TRUE" ]; then bash <(curl -s https://codecov.io/bash); fi

cache:
directories:
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,16 @@
ChangeLog
=========

4.3.4 (2020-07-27)
------------------

* # 16 Merge upstream changes from sabre-io/vobject:4.3.1 into protonlabs/vobject

4.3.3 (2020-07-22)
------------------

* #15 Expose RRULE properties

4.3.2 (2020-05-20)
------------------

Expand Down
30 changes: 25 additions & 5 deletions composer.json
Expand Up @@ -32,12 +32,14 @@
"homepage" : "http://sabre.io/vobject/",
"license" : "BSD-3-Clause",
"require" : {
"php" : ">=5.5",
"php" : "^7.1",
"ext-mbstring" : "*",
"sabre/xml" : ">=1.5 <3.0"
"sabre/xml" : "^2.1"
},
"require-dev" : {
"phpunit/phpunit" : "> 4.8.35, <6.0.0"
"friendsofphp/php-cs-fixer": "~2.16.1",
"phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0",
"phpstan/phpstan": "^0.12"
},
"suggest" : {
"hoa/bench" : "If you would like to run the benchmark scripts"
Expand Down Expand Up @@ -71,6 +73,11 @@
"Sabre\\VObject\\" : "lib/"
}
},
"autoload-dev" : {
"psr-4" : {
"Sabre\\VObject\\" : "tests/VObject"
}
},
"bin" : [
"bin/vobject",
"bin/generate_vcards"
Expand All @@ -80,7 +87,20 @@
"dev-master" : "4.0.x-dev"
}
},
"config" : {
"bin-dir" : "bin"
"scripts": {
"phpstan": [
"phpstan analyse lib tests"
],
"cs-fixer": [
"php-cs-fixer fix"
],
"phpunit": [
"phpunit --configuration tests/phpunit.xml"
],
"test": [
"composer phpstan",
"composer cs-fixer",
"composer phpunit"
]
}
}
14 changes: 3 additions & 11 deletions lib/Cli.php
Expand Up @@ -29,7 +29,7 @@ class Cli
protected $showHelp = false;

/**
* Wether to spit out 'mimedir' or 'json' format.
* Whether to spit out 'mimedir' or 'json' format.
*
* @var string
*/
Expand Down Expand Up @@ -289,7 +289,7 @@ protected function showHelp()
$this->log($this->colorize('green', ' validate').' source_file Validates a file for correctness.');
$this->log($this->colorize('green', ' repair').' source_file [output_file] Repairs a file.');
$this->log($this->colorize('green', ' convert').' source_file [output_file] Converts a file.');
$this->log($this->colorize('green', ' color').' source_file Colorize a file, useful for debbugging.');
$this->log($this->colorize('green', ' color').' source_file Colorize a file, useful for debugging.');
$this->log(
<<<HELP
Expand All @@ -312,8 +312,6 @@ protected function showHelp()
/**
* Validates a VObject file.
*
* @param Component $vObj
*
* @return int
*/
protected function validate(Component $vObj)
Expand Down Expand Up @@ -354,8 +352,6 @@ protected function validate(Component $vObj)
/**
* Repairs a VObject file.
*
* @param Component $vObj
*
* @return int
*/
protected function repair(Component $vObj)
Expand Down Expand Up @@ -516,7 +512,7 @@ protected function serializeComponent(Component $vObj)
*
* A higher score means the item will be lower in the list.
* To avoid score collisions, each "score category" has a reasonable
* space to accomodate elements. The $key is added to the $score to
* space to accommodate elements. The $key is added to the $score to
* preserve the original relative order of elements.
*
* @param int $key
Expand Down Expand Up @@ -582,8 +578,6 @@ function ($a, $b) use ($sortScore, $tmp) {

/**
* Colorizes a property.
*
* @param Property $property
*/
protected function serializeProperty(Property $property)
{
Expand Down Expand Up @@ -642,8 +636,6 @@ protected function serializeProperty(Property $property)

/**
* Parses the list of arguments.
*
* @param array $argv
*/
protected function parseArguments(array $argv)
{
Expand Down
10 changes: 4 additions & 6 deletions lib/Component.php
Expand Up @@ -43,10 +43,8 @@ class Component extends Node
* an iCalendar object, this may be something like CALSCALE:GREGORIAN. To
* ensure that this does not happen, set $defaults to false.
*
* @param Document $root
* @param string $name such as VCALENDAR, VEVENT
* @param array $children
* @param bool $defaults
* @param string $name such as VCALENDAR, VEVENT
* @param bool $defaults
*/
public function __construct(Document $root, $name, array $children = [], $defaults = true)
{
Expand Down Expand Up @@ -276,7 +274,7 @@ public function serialize()
*
* A higher score means the item will be lower in the list.
* To avoid score collisions, each "score category" has a reasonable
* space to accomodate elements. The $key is added to the $score to
* space to accommodate elements. The $key is added to the $score to
* preserve the original relative order of elements.
*
* @param int $key
Expand Down Expand Up @@ -433,7 +431,7 @@ protected function getDefaults()
*
* @param string $name
*
* @return Property
* @return Property|null
*/
public function __get($name)
{
Expand Down
3 changes: 0 additions & 3 deletions lib/Component/VAvailability.php
Expand Up @@ -26,9 +26,6 @@ class VAvailability extends VObject\Component
*
* https://tools.ietf.org/html/draft-daboo-calendar-availability-05#section-3.1
*
* @param DateTimeInterface $start
* @param DateTimeInterface $end
*
* @return bool
*/
public function isInTimeRange(DateTimeInterface $start, DateTimeInterface $end)
Expand Down

0 comments on commit 10a03a8

Please sign in to comment.