diff options
Diffstat (limited to 'vendor/sabre')
96 files changed, 1302 insertions, 667 deletions
diff --git a/vendor/sabre/dav/.github/workflows/ci.yml b/vendor/sabre/dav/.github/workflows/ci.yml new file mode 100644 index 000000000..f41b38535 --- /dev/null +++ b/vendor/sabre/dav/.github/workflows/ci.yml @@ -0,0 +1,127 @@ +name: continuous-integration +on: + push: + branches: + - master + - release/* + pull_request: + +jobs: + code-analysis: + runs-on: ubuntu-latest + name: Code Analysis (PHP ${{ matrix.php-versions }}) + strategy: + fail-fast: false + matrix: + php-versions: [ '7.4' ] + 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 + 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.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: PHP CS-Fixer + run: php vendor/bin/php-cs-fixer fix --dry-run --diff + + - name: PHPStan + run: composer phpstan + + unit-testing: + name: PHPUnit (PHP ${{ matrix.php-versions }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-versions: [ '7.1', '7.2', '7.3', '7.4', '8.0' ] + coverage: [ 'none' ] + streaming: [ false ] + include: + - php-versions: '8.1' + coverage: 'pcov' + streaming: true + + services: + mariadb: + image: mariadb + env: + MARIADB_DATABASE: 'sabredav_test' + MARIADB_ROOT_PASSWORD: root + ports: + - 3306:3306 + postgres: + image: postgres + env: + POSTGRES_DB: 'sabredav_test' + POSTGRES_PASSWORD: postgres + ports: + - 5432:5432 + 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, pdo_sqlite, pgsql, 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.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Composer dependencies + run: composer install --no-progress --prefer-dist --optimize-autoloader + + - name: PHPUnit + if: matrix.streaming == false + run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml + env: + SABRE_MYSQLUSER: root + SABRE_MYSQLPASS: root + SABRE_MYSQLDSN: "mysql:host=127.0.0.1;port=3306;dbname=sabredav_test" + SABRE_PGSQLDSN: "pgsql:host=127.0.0.1;port=5432;dbname=sabredav_test;user=postgres;password=postgres" + + - name: PHPUnit (with streaming) + if: matrix.streaming == true + run: vendor/bin/phpunit --verbose --configuration tests/phpunit.xml --coverage-clover=coverage.xml + env: + SABRE_MYSQLUSER: root + SABRE_MYSQLPASS: root + SABRE_MYSQLDSN: "mysql:host=127.0.0.1;port=3306;dbname=sabredav_test" + SABRE_PGSQLDSN: "pgsql:host=127.0.0.1;port=5432;dbname=sabredav_test;user=postgres;password=postgres" + RUN_TEST_WITH_STREAMING_PROPFIND: "true" + + - uses: codecov/codecov-action@v2 + if: matrix.coverage != 'none' diff --git a/vendor/sabre/dav/composer.json b/vendor/sabre/dav/composer.json index 7c9596d21..5f0a44d66 100644 --- a/vendor/sabre/dav/composer.json +++ b/vendor/sabre/dav/composer.json @@ -29,7 +29,7 @@ "ext-date" : "*", "ext-iconv" : "*", "lib-libxml" : ">=2.7.0", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", "ext-json": "*" }, "require-dev" : { diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php index 0d5df3968..2f48ab982 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php @@ -948,42 +948,46 @@ SQL; } list($calendarId, $instanceId) = $calendarId; - // Current synctoken - $stmt = $this->pdo->prepare('SELECT synctoken FROM '.$this->calendarTableName.' WHERE id = ?'); - $stmt->execute([$calendarId]); - $currentToken = $stmt->fetchColumn(0); - - if (is_null($currentToken)) { - return null; - } - $result = [ - 'syncToken' => $currentToken, 'added' => [], 'modified' => [], 'deleted' => [], ]; if ($syncToken) { - $query = 'SELECT uri, operation FROM '.$this->calendarChangesTableName.' WHERE synctoken >= ? AND synctoken < ? AND calendarid = ? ORDER BY synctoken'; + $query = 'SELECT uri, operation, synctoken FROM '.$this->calendarChangesTableName.' WHERE synctoken >= ? AND calendarid = ? ORDER BY synctoken'; if ($limit > 0) { - $query .= ' LIMIT '.(int) $limit; + // Fetch one more raw to detect result truncation + $query .= ' LIMIT '.((int) $limit + 1); } // Fetching all changes $stmt = $this->pdo->prepare($query); - $stmt->execute([$syncToken, $currentToken, $calendarId]); + $stmt->execute([$syncToken, $calendarId]); $changes = []; // This loop ensures that any duplicates are overwritten, only the // last change on a node is relevant. while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $changes[$row['uri']] = $row['operation']; + $changes[$row['uri']] = $row; } + $currentToken = null; + $result_count = 0; foreach ($changes as $uri => $operation) { - switch ($operation) { + if (!is_null($limit) && $result_count >= $limit) { + $result['result_truncated'] = true; + break; + } + + if (null === $currentToken || $currentToken < $operation['synctoken'] + 1) { + // SyncToken in CalDAV perspective is consistently the next number of the last synced change event in this class. + $currentToken = $operation['synctoken'] + 1; + } + + ++$result_count; + switch ($operation['operation']) { case 1: $result['added'][] = $uri; break; @@ -995,7 +999,24 @@ SQL; break; } } + + if (!is_null($currentToken)) { + $result['syncToken'] = $currentToken; + } else { + // This means returned value is equivalent to syncToken + $result['syncToken'] = $syncToken; + } } else { + // Current synctoken + $stmt = $this->pdo->prepare('SELECT synctoken FROM '.$this->calendarTableName.' WHERE id = ?'); + $stmt->execute([$calendarId]); + $currentToken = $stmt->fetchColumn(0); + + if (is_null($currentToken)) { + return null; + } + $result['syncToken'] = $currentToken; + // No synctoken supplied, this is the initial sync. $query = 'SELECT uri FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?'; $stmt = $this->pdo->prepare($query); diff --git a/vendor/sabre/dav/lib/CalDAV/Calendar.php b/vendor/sabre/dav/lib/CalDAV/Calendar.php index 9f32e702a..6e989314d 100644 --- a/vendor/sabre/dav/lib/CalDAV/Calendar.php +++ b/vendor/sabre/dav/lib/CalDAV/Calendar.php @@ -396,7 +396,8 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * 'deleted' => [ * 'foo.php.bak', * 'old.txt' - * ] + * ], + * 'result_truncated' : true * ]; * * The syncToken property should reflect the *current* syncToken of the @@ -406,6 +407,9 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * If the syncToken is specified as null, this is an initial sync, and all * members should be reported. * + * If result is truncated due to server limitation or limit by client, + * set result_truncated to true, otherwise set to false or do not add the key. + * * The modified property is an array of nodenames that have changed since * the last token. * @@ -422,12 +426,17 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * should be treated as infinite. * * If the limit (infinite or not) is higher than you're willing to return, - * you should throw a Sabre\DAV\Exception\TooMuchMatches() exception. + * the result should be truncated to fit the limit. + * Note that even when the result is truncated, syncToken must be consistent + * with the truncated result, not the result before truncation. + * (See RFC6578 Section 3.6 for detail) * * If the syncToken is expired (due to data cleanup) or unknown, you must * return null. * * The limit is 'suggestive'. You are free to ignore it. + * TODO: RFC6578 Setion 3.7 says that the server must fail when the server + * cannot truncate according to the limit, so it may not be just suggestive. * * @param string $syncToken * @param int $syncLevel diff --git a/vendor/sabre/dav/lib/CalDAV/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Plugin.php index da172049e..98f4f554c 100644 --- a/vendor/sabre/dav/lib/CalDAV/Plugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Plugin.php @@ -243,7 +243,7 @@ class Plugin extends DAV\ServerPlugin * @param mixed $report * @param mixed $path * - * @return bool + * @return bool|null */ public function report($reportName, $report, $path) { diff --git a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php index 38a7ca96f..3cc360f1d 100644 --- a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php @@ -735,9 +735,7 @@ class Plugin extends ServerPlugin /** * This method is responsible for parsing a free-busy query request and - * returning it's result. - * - * @return string + * returning its result in $response. */ protected function handleFreeBusyRequest(IOutbox $outbox, VObject\Component $vObject, RequestInterface $request, ResponseInterface $response) { diff --git a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php index 3be1b609e..8d56e6441 100644 --- a/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php +++ b/vendor/sabre/dav/lib/CalDAV/Subscriptions/Subscription.php @@ -75,7 +75,7 @@ class Subscription extends Collection implements ISubscription, IACL /** * Returns the last modification time. * - * @return int + * @return int|null */ public function getLastModified() { diff --git a/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php b/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php new file mode 100644 index 000000000..39324e4db --- /dev/null +++ b/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php @@ -0,0 +1,114 @@ +<?php + +namespace Sabre\DAV\Auth\Backend; + +/** + * This is an authentication backend that uses a database to manage passwords. + * + * @copyright Copyright (C) fruux GmbH (https://fruux.com/) + * @license http://sabre.io/license/ Modified BSD License + */ +class PDOBasicAuth extends AbstractBasic +{ + /** + * Reference to PDO connection. + * + * @var PDO + */ + protected $pdo; + + /** + * PDO table name we'll be using. + * + * @var string + */ + protected $tableName; + + /** + * PDO digest column name we'll be using + * (i.e. digest, password, password_hash). + * + * @var string + */ + protected $digestColumn; + + /** + * PDO uuid(unique user identifier) column name we'll be using + * (i.e. username, email). + * + * @var string + */ + protected $uuidColumn; + + /** + * Digest prefix: + * if the backend you are using for is prefixing + * your password hashes set this option to your prefix to + * cut it off before verfiying. + * + * @var string + */ + protected $digestPrefix; + + /** + * Creates the backend object. + * + * If the filename argument is passed in, it will parse out the specified file fist. + */ + public function __construct(\PDO $pdo, array $options = []) + { + $this->pdo = $pdo; + if (isset($options['tableName'])) { + $this->tableName = $options['tableName']; + } else { + $this->tableName = 'users'; + } + if (isset($options['digestColumn'])) { + $this->digestColumn = $options['digestColumn']; + } else { + $this->digestColumn = 'digest'; + } + if (isset($options['uuidColumn'])) { + $this->uuidColumn = $options['uuidColumn']; + } else { + $this->uuidColumn = 'username'; + } + if (isset($options['digestPrefix'])) { + $this->digestPrefix = $options['digestPrefix']; + } + } + + /** + * Validates a username and password. + * + * This method should return true or false depending on if login + * succeeded. + * + * @param string $username + * @param string $password + * + * @return bool + */ + public function validateUserPass($username, $password) + { + $stmt = $this->pdo->prepare('SELECT '.$this->digestColumn.' FROM '.$this->tableName.' WHERE '.$this->uuidColumn.' = ?'); + $stmt->execute([$username]); + $result = $stmt->fetchAll(); + + if (!count($result)) { + return false; + } else { + $digest = $result[0][$this->digestColumn]; + + if (isset($this->digestPrefix)) { + $digest = substr($digest, strlen($this->digestPrefix)); + } + + if (password_verify($password, $digest)) { + return true; + } + + return false; + } + } +} diff --git a/vendor/sabre/dav/lib/DAV/Auth/Plugin.php b/vendor/sabre/dav/lib/DAV/Auth/Plugin.php index 68adbede5..eb4f27ca6 100644 --- a/vendor/sabre/dav/lib/DAV/Auth/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Auth/Plugin.php @@ -113,8 +113,6 @@ class Plugin extends ServerPlugin /** * This method is called before any HTTP method and forces users to be authenticated. - * - * @return bool */ public function beforeMethod(RequestInterface $request, ResponseInterface $response) { @@ -204,8 +202,6 @@ class Plugin extends ServerPlugin * This method will for example cause a HTTP Basic backend to set a * WWW-Authorization header, indicating to the client that it should * authenticate. - * - * @return array */ public function challenge(RequestInterface $request, ResponseInterface $response) { diff --git a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php index 2f155d9ea..89495e5db 100644 --- a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php @@ -85,8 +85,6 @@ class Plugin extends DAV\ServerPlugin /** * This method intercepts GET requests that have ?sabreAction=info * appended to the URL. - * - * @return bool */ public function httpGetEarly(RequestInterface $request, ResponseInterface $response) { diff --git a/vendor/sabre/dav/lib/DAV/Locks/Plugin.php b/vendor/sabre/dav/lib/DAV/Locks/Plugin.php index 110bfce06..2443f204c 100644 --- a/vendor/sabre/dav/lib/DAV/Locks/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Locks/Plugin.php @@ -295,6 +295,10 @@ class Plugin extends DAV\ServerPlugin { $locks = $this->getLocks($path, $includeChildren = true); foreach ($locks as $lock) { + // don't delete a lock on a parent dir + if (0 !== strpos($lock->uri, $path)) { + continue; + } $this->unlockNode($path, $lock); } } diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php index de663d0c1..1f8300d4a 100644 --- a/vendor/sabre/dav/lib/DAV/Server.php +++ b/vendor/sabre/dav/lib/DAV/Server.php @@ -895,7 +895,7 @@ class Server implements LoggerAwareInterface, EmitterInterface } $propertyNames = $propFind->getRequestedProperties(); - $propFindType = !empty($propertyNames) ? PropFind::NORMAL : PropFind::ALLPROPS; + $propFindType = !$propFind->isAllProps() ? PropFind::NORMAL : PropFind::ALLPROPS; foreach ($this->tree->getChildren($path) as $childNode) { if ('' !== $path) { @@ -1237,6 +1237,7 @@ class Server implements LoggerAwareInterface, EmitterInterface $this->tree->markDirty($parentUri); $this->emit('afterBind', [$uri]); + $this->emit('afterCreateCollection', [$uri]); } /** diff --git a/vendor/sabre/dav/lib/DAV/Sync/Plugin.php b/vendor/sabre/dav/lib/DAV/Sync/Plugin.php index 32106abb3..8609f759e 100644 --- a/vendor/sabre/dav/lib/DAV/Sync/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Sync/Plugin.php @@ -124,6 +124,10 @@ class Plugin extends DAV\ServerPlugin throw new DAV\Exception\InvalidSyncToken('Invalid or unknown sync token'); } + if (!array_key_exists('result_truncated', $changeInfo)) { + $changeInfo['result_truncated'] = false; + } + // Encoding the response $this->sendSyncCollectionResponse( $changeInfo['syncToken'], @@ -131,7 +135,8 @@ class Plugin extends DAV\ServerPlugin $changeInfo['added'], $changeInfo['modified'], $changeInfo['deleted'], - $report->properties + $report->properties, + $changeInfo['result_truncated'] ); } @@ -141,7 +146,7 @@ class Plugin extends DAV\ServerPlugin * @param string $syncToken * @param string $collectionUrl */ - protected function sendSyncCollectionResponse($syncToken, $collectionUrl, array $added, array $modified, array $deleted, array $properties) + protected function sendSyncCollectionResponse($syncToken, $collectionUrl, array $added, array $modified, array $deleted, array $properties, bool $resultTruncated = false) { $fullPaths = []; @@ -164,6 +169,10 @@ class Plugin extends DAV\ServerPlugin $fullPath = $collectionUrl.'/'.$item; $responses[] = new DAV\Xml\Element\Response($fullPath, [], 404); } + if ($resultTruncated) { + $responses[] = new DAV\Xml\Element\Response($collectionUrl.'/', [], 507); + } + $multiStatus = new DAV\Xml\Response\MultiStatus($responses, self::SYNCTOKEN_PREFIX.$syncToken); $this->server->httpResponse->setStatus(207); diff --git a/vendor/sabre/dav/lib/DAV/Tree.php b/vendor/sabre/dav/lib/DAV/Tree.php index 2417979a6..8215e2c39 100644 --- a/vendor/sabre/dav/lib/DAV/Tree.php +++ b/vendor/sabre/dav/lib/DAV/Tree.php @@ -226,7 +226,7 @@ class Tree // flushing the entire cache $path = trim($path, '/'); foreach ($this->cache as $nodePath => $node) { - if ('' === $path || $nodePath == $path || 0 === strpos($nodePath, $path.'/')) { + if ('' === $path || $nodePath == $path || 0 === strpos((string) $nodePath, $path.'/')) { unset($this->cache[$nodePath]); } } diff --git a/vendor/sabre/dav/lib/DAV/Version.php b/vendor/sabre/dav/lib/DAV/Version.php index b25d6c07a..f8b56bb98 100644 --- a/vendor/sabre/dav/lib/DAV/Version.php +++ b/vendor/sabre/dav/lib/DAV/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.1.5'; + public const VERSION = '4.3.1'; } diff --git a/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php b/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php index 45c161fa4..79f06a09b 100644 --- a/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php +++ b/vendor/sabre/dav/lib/DAV/Xml/Element/Response.php @@ -121,7 +121,7 @@ class Response implements Element foreach ($this->getResponseProperties() as $status => $properties) { // Skipping empty lists - if (!$properties || (!ctype_digit($status) && !is_int($status))) { + if (!$properties || (!is_int($status) && !ctype_digit($status))) { continue; } $empty = false; @@ -186,8 +186,21 @@ class Response implements Element return []; } + + if (!$reader->read()) { + $reader->next(); + + return []; + } + + if (Reader::END_ELEMENT === $reader->nodeType) { + $reader->next(); + + return []; + } + $values = []; - $reader->read(); + do { if (Reader::ELEMENT === $reader->nodeType) { $clark = $reader->getClark(); @@ -199,9 +212,12 @@ class Response implements Element $values[$clark] = $reader->parseCurrentElement()['value']; } } else { - $reader->read(); + if (!$reader->read()) { + break; + } } } while (Reader::END_ELEMENT !== $reader->nodeType); + $reader->read(); return $values; diff --git a/vendor/sabre/dav/lib/DAVACL/Plugin.php b/vendor/sabre/dav/lib/DAVACL/Plugin.php index 6f071927d..46d680e15 100644 --- a/vendor/sabre/dav/lib/DAVACL/Plugin.php +++ b/vendor/sabre/dav/lib/DAVACL/Plugin.php @@ -927,8 +927,6 @@ class Plugin extends DAV\ServerPlugin * Triggered before properties are looked up in specific nodes. * * @TODO really should be broken into multiple methods, or even a class. - * - * @return bool */ public function propFind(DAV\PropFind $propFind, DAV\INode $node) { @@ -1070,8 +1068,6 @@ class Plugin extends DAV\ServerPlugin * @param string $reportName * @param mixed $report * @param mixed $path - * - * @return bool */ public function report($reportName, $report, $path) { diff --git a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/AbstractBackend.php b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/AbstractBackend.php index 03a9c4bad..f61a0c953 100644 --- a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/AbstractBackend.php +++ b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/AbstractBackend.php @@ -33,7 +33,7 @@ abstract class AbstractBackend implements BackendInterface * @param string $uri * @param string $principalPrefix * - * @return string + * @return string|null */ public function findByUri($uri, $principalPrefix) { diff --git a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php index 72717a59b..7140a9295 100644 --- a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php +++ b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/BackendInterface.php @@ -110,7 +110,7 @@ interface BackendInterface * @param string $uri * @param string $principalPrefix * - * @return string + * @return string|null */ public function findByUri($uri, $principalPrefix); diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php index 24aeffad9..52092128f 100644 --- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php +++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php @@ -142,6 +142,8 @@ class Principal extends DAV\Xml\Property\Href case self::ALL: return '<em>all</em>'; } + + return '<em>unknown</em>'; } /** diff --git a/vendor/sabre/event/.github/workflows/ci.yml b/vendor/sabre/event/.github/workflows/ci.yml new file mode 100644 index 000000000..3473cd2de --- /dev/null +++ b/vendor/sabre/event/.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.lock') }} + 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' diff --git a/vendor/sabre/event/composer.json b/vendor/sabre/event/composer.json index 181afe190..42fb4aa22 100644 --- a/vendor/sabre/event/composer.json +++ b/vendor/sabre/event/composer.json @@ -46,7 +46,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" }, diff --git a/vendor/sabre/event/lib/EventEmitter.php b/vendor/sabre/event/lib/EventEmitter.php index 18971e3ee..865c99b53 100644 --- a/vendor/sabre/event/lib/EventEmitter.php +++ b/vendor/sabre/event/lib/EventEmitter.php @@ -7,7 +7,7 @@ namespace Sabre\Event; /** * This is the old name for the Emitter class. * - * Instead of of using EventEmitter, please use Emitter. They are identical + * Instead of using EventEmitter, please use Emitter. They are identical * otherwise. * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) diff --git a/vendor/sabre/event/lib/Loop/Loop.php b/vendor/sabre/event/lib/Loop/Loop.php index ec09be921..b85a7a440 100644 --- a/vendor/sabre/event/lib/Loop/Loop.php +++ b/vendor/sabre/event/lib/Loop/Loop.php @@ -273,7 +273,9 @@ class Loop $read = $this->readStreams; $write = $this->writeStreams; $except = null; - if (stream_select($read, $write, $except, (null === $timeout) ? null : 0, $timeout ? (int) ($timeout * 1000000) : 0)) { + // stream_select changes behavior in 8.1 to forbid passing non-null microseconds when the seconds are null. + // Older versions of php don't allow passing null to microseconds. + if (null !== $timeout ? stream_select($read, $write, $except, 0, (int) ($timeout * 1000000)) : stream_select($read, $write, $except, null)) { // See PHP Bug https://bugs.php.net/bug.php?id=62452 // Fixed in PHP7 foreach ($read as $readStream) { diff --git a/vendor/sabre/event/lib/Promise.php b/vendor/sabre/event/lib/Promise.php index 1228561af..42969a55f 100644 --- a/vendor/sabre/event/lib/Promise.php +++ b/vendor/sabre/event/lib/Promise.php @@ -144,7 +144,7 @@ class Promise } /** - * Marks this promise as rejected, and set it's rejection reason. + * Marks this promise as rejected, and set its rejection reason. */ public function reject(Throwable $reason) { diff --git a/vendor/sabre/event/lib/Promise/functions.php b/vendor/sabre/event/lib/Promise/functions.php index 986fe2b00..fbed63471 100644 --- a/vendor/sabre/event/lib/Promise/functions.php +++ b/vendor/sabre/event/lib/Promise/functions.php @@ -18,7 +18,7 @@ use Throwable; /** * This function takes an array of Promises, and returns a Promise that - * resolves when all of the given arguments have resolved. + * resolves when all the given arguments have resolved. * * The returned Promise will resolve with a value that's an array of all the * values the given promises have been resolved with. diff --git a/vendor/sabre/event/lib/Version.php b/vendor/sabre/event/lib/Version.php index 457aea9b2..fe8f5c3bf 100644 --- a/vendor/sabre/event/lib/Version.php +++ b/vendor/sabre/event/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.2'; + const VERSION = '5.1.4'; } diff --git a/vendor/sabre/event/lib/WildcardEmitter.php b/vendor/sabre/event/lib/WildcardEmitter.php index 1b7c248b2..997709e8a 100644 --- a/vendor/sabre/event/lib/WildcardEmitter.php +++ b/vendor/sabre/event/lib/WildcardEmitter.php @@ -22,9 +22,9 @@ namespace Sabre\Event; * - Using ":" as a separator is optional, but it's highly recommended to use * some kind of separator. * - * The WilcardEmitter is a bit slower than the regular Emitter. If you code + * The WildcardEmitter is a bit slower than the regular Emitter. If your code * must be very high performance, it might be better to try to use the other - * emitter. For must usage the difference is negligible though. + * emitter. For most usage the difference is negligible though. * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) * @author Evert Pot (http://evertpot.com/) diff --git a/vendor/sabre/http/.github/workflows/ci.yml b/vendor/sabre/http/.github/workflows/ci.yml new file mode 100644 index 000000000..91b509bf0 --- /dev/null +++ b/vendor/sabre/http/.github/workflows/ci.yml @@ -0,0 +1,64 @@ +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: ctype, curl, mbstring + 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 }} + 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: Run application server + run: php -S localhost:8000 -t tests/www 2>/dev/null & + + - 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' diff --git a/vendor/sabre/http/.travis.yml b/vendor/sabre/http/.travis.yml deleted file mode 100644 index c93e4ae75..000000000 --- a/vendor/sabre/http/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: php -sudo: required -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - global: - - RUN_PHPCSFIXER="TRUE" - - RUN_PHPUNIT="TRUE" - - 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: 'PHP8' - dist: focal - php: nightly - env: - - RUN_PHPCSFIXER="FALSE" - - REPORT_COVERAGE="FALSE" - - name: 'PHPStan' - php: 7.4 - env: - - RUN_PHPCSFIXER="FALSE" - - RUN_PHPUNIT="FALSE" - - RUN_PHPSTAN="TRUE" - - REPORT_COVERAGE="FALSE" - fast_finish: true - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - if [ $RUN_PHPCSFIXER == "FALSE" ]; then composer remove --dev friendsofphp/php-cs-fixer; fi - - composer update $PREFER_LOWEST - - PHP_BIN=$(phpenv which php) - - sudo $PHP_BIN -S localhost:80 -t $TRAVIS_BUILD_DIR/tests/www 2>/dev/null & - -script: - - if [ $RUN_PHPCSFIXER == "TRUE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi - - if [ $RUN_PHPUNIT == "TRUE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE; fi - - if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi - -after_success: - - if [ $REPORT_COVERAGE == "TRUE" ]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md index eb226f7a5..4db8cc772 100644 --- a/vendor/sabre/http/CHANGELOG.md +++ b/vendor/sabre/http/CHANGELOG.md @@ -1,6 +1,18 @@ ChangeLog ========= +5.1.3 (2021-11-04) +------------------ + +* #179 version bump that was missed in 5.1.2 (@phil-davis) + +5.1.2 (2021-11-04) +------------------------- + +* #169 Ensure $_SERVER keys are read as strings (@fredrik-eriksson) +* #170 Fix deprecated usages on PHP 8.1 (@cedric-anne) +* #175 Add resource size to CURL options in client (from #172 ) (@Dartui) + 5.1.1 (2020-10-03) ------------------------- diff --git a/vendor/sabre/http/composer.json b/vendor/sabre/http/composer.json index 7f54df6e8..353646a28 100644 --- a/vendor/sabre/http/composer.json +++ b/vendor/sabre/http/composer.json @@ -13,7 +13,7 @@ "sabre/uri" : "^2.0" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" }, diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index b79c564da..99ffcf8cb 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -376,11 +376,16 @@ class Client extends EventEmitter default: $body = $request->getBody(); if (is_resource($body)) { + $bodyStat = fstat($body); + // This needs to be set to PUT, regardless of the actual // method used. Without it, INFILE will be ignored for some // reason. $settings[CURLOPT_PUT] = true; - $settings[CURLOPT_INFILE] = $request->getBody(); + $settings[CURLOPT_INFILE] = $body; + if (false !== $bodyStat && array_key_exists('size', $bodyStat)) { + $settings[CURLOPT_INFILESIZE] = $bodyStat['size']; + } } else { // For security we cast this to a string. If somehow an array could // be passed here, it would be possible for an attacker to use @ to diff --git a/vendor/sabre/http/lib/Message.php b/vendor/sabre/http/lib/Message.php index 90153fda5..6474f38d2 100644 --- a/vendor/sabre/http/lib/Message.php +++ b/vendor/sabre/http/lib/Message.php @@ -88,7 +88,7 @@ abstract class Message implements MessageInterface * @var string|int|null */ $contentLength = $this->getHeader('Content-Length'); - if (is_int($contentLength) || ctype_digit($contentLength)) { + if (null !== $contentLength && (is_int($contentLength) || ctype_digit($contentLength))) { return stream_get_contents($body, (int) $contentLength); } diff --git a/vendor/sabre/http/lib/Response.php b/vendor/sabre/http/lib/Response.php index 64dfbc0b2..2369bb41e 100644 --- a/vendor/sabre/http/lib/Response.php +++ b/vendor/sabre/http/lib/Response.php @@ -149,7 +149,7 @@ class Response extends Message implements ResponseInterface */ public function setStatus($status) { - if (ctype_digit($status) || is_int($status)) { + if (is_int($status) || ctype_digit($status)) { $statusCode = $status; $statusText = self::$statusCodes[$status] ?? 'Unknown'; } else { diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index 73674a5a1..823d5df25 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -154,6 +154,7 @@ class Sapi $hostName = 'localhost'; foreach ($serverArray as $key => $value) { + $key = (string) $key; switch ($key) { case 'SERVER_PROTOCOL': if ('HTTP/1.0' === $value) { diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 624e2a78e..f182979c6 100644 --- a/vendor/sabre/http/lib/Version.php +++ b/vendor/sabre/http/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '5.1.1'; + const VERSION = '5.1.3'; } diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php index a23840a1a..97673da46 100644 --- a/vendor/sabre/http/lib/functions.php +++ b/vendor/sabre/http/lib/functions.php @@ -331,8 +331,8 @@ function parseMimeType(string $str): array if (2 !== count($mimeType)) { // Illegal value var_dump($mimeType); - die(); - throw new InvalidArgumentException('Not a valid mime-type: '.$str); + exit(); + // throw new InvalidArgumentException('Not a valid mime-type: '.$str); } list($type, $subType) = $mimeType; diff --git a/vendor/sabre/uri/.github/workflows/ci.yml b/vendor/sabre/uri/.github/workflows/ci.yml new file mode 100644 index 000000000..3473cd2de --- /dev/null +++ b/vendor/sabre/uri/.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.lock') }} + 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' diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json index 4a68797a5..d58fd51f7 100644 --- a/vendor/sabre/uri/composer.json +++ b/vendor/sabre/uri/composer.json @@ -37,7 +37,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" }, diff --git a/vendor/sabre/uri/lib/Version.php b/vendor/sabre/uri/lib/Version.php index 4a6c58405..4527a0d8a 100644 --- a/vendor/sabre/uri/lib/Version.php +++ b/vendor/sabre/uri/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.1'; + const VERSION = '2.2.2'; } diff --git a/vendor/sabre/uri/lib/functions.php b/vendor/sabre/uri/lib/functions.php index 0d64cead0..18a324337 100644 --- a/vendor/sabre/uri/lib/functions.php +++ b/vendor/sabre/uri/lib/functions.php @@ -84,7 +84,7 @@ function resolve(string $basePath, string $newPath): string $path = implode('/', $newPathParts); // If the source url ended with a /, we want to preserve that. - $newParts['path'] = $path; + $newParts['path'] = 0 === strpos($path, '/') ? $path : '/'.$path; if ($delta['query']) { $newParts['query'] = $delta['query']; } elseif (!empty($base['query']) && empty($delta['host']) && empty($delta['path'])) { @@ -214,7 +214,7 @@ function parse(string $uri): array * This function takes the components returned from PHP's parse_url, and uses * it to generate a new uri. * - * @param array<string, int|string> $parts + * @param array<string, int|string|null> $parts */ function build(array $parts): string { @@ -261,7 +261,7 @@ function build(array $parts): string * is used) and we need a method that just operates on UTF-8 characters. * * In addition basename and dirname are platform aware, and will treat - * backslash (\) as a directory separator on windows. + * backslash (\) as a directory separator on Windows. * * This method returns the 2 components as an array. * diff --git a/vendor/sabre/vobject/.github/workflows/ci.yml b/vendor/sabre/vobject/.github/workflows/ci.yml new file mode 100644 index 000000000..3a019fe77 --- /dev/null +++ b/vendor/sabre/vobject/.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' diff --git a/vendor/sabre/vobject/README.md b/vendor/sabre/vobject/README.md index 5030cf276..659e3fa83 100644 --- a/vendor/sabre/vobject/README.md +++ b/vendor/sabre/vobject/README.md @@ -4,7 +4,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 diff --git a/vendor/sabre/vobject/lib/Cli.php b/vendor/sabre/vobject/lib/Cli.php index 4984ac9b2..816e2cb31 100644 --- a/vendor/sabre/vobject/lib/Cli.php +++ b/vendor/sabre/vobject/lib/Cli.php @@ -453,8 +453,6 @@ HELP * Colorizes a file. * * @param Component $vObj - * - * @return int */ protected function color($vObj) { diff --git a/vendor/sabre/vobject/lib/Component.php b/vendor/sabre/vobject/lib/Component.php index 07f6a627f..f33b628a7 100644 --- a/vendor/sabre/vobject/lib/Component.php +++ b/vendor/sabre/vobject/lib/Component.php @@ -339,6 +339,7 @@ class Component extends Node * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $components = []; diff --git a/vendor/sabre/vobject/lib/Component/VCard.php b/vendor/sabre/vobject/lib/Component/VCard.php index 2430df621..eac789842 100644 --- a/vendor/sabre/vobject/lib/Component/VCard.php +++ b/vendor/sabre/vobject/lib/Component/VCard.php @@ -445,6 +445,7 @@ class VCard extends VObject\Document * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { // A vcard does not have sub-components, so we're overriding this diff --git a/vendor/sabre/vobject/lib/ElementList.php b/vendor/sabre/vobject/lib/ElementList.php index 56058cbd5..860512649 100644 --- a/vendor/sabre/vobject/lib/ElementList.php +++ b/vendor/sabre/vobject/lib/ElementList.php @@ -25,6 +25,7 @@ class ElementList extends ArrayIterator * @param int $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { throw new LogicException('You can not add new objects to an ElementList'); @@ -37,6 +38,7 @@ class ElementList extends ArrayIterator * * @param int $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { throw new LogicException('You can not remove objects from an ElementList'); diff --git a/vendor/sabre/vobject/lib/ITip/Broker.php b/vendor/sabre/vobject/lib/ITip/Broker.php index 4e0368e13..b66a59f54 100644 --- a/vendor/sabre/vobject/lib/ITip/Broker.php +++ b/vendor/sabre/vobject/lib/ITip/Broker.php @@ -547,9 +547,13 @@ class Broker // properties changed in the event, or simply if there's a // difference in instances that the attendee is invited to. + $oldAttendeeInstances = array_keys($attendee['oldInstances']); + $newAttendeeInstances = array_keys($attendee['newInstances']); + $message->significantChange = 'REQUEST' === $attendee['forceSend'] || - array_keys($attendee['oldInstances']) != array_keys($attendee['newInstances']) || + count($oldAttendeeInstances) != count($newAttendeeInstances) || + count(array_diff($oldAttendeeInstances, $newAttendeeInstances)) > 0 || $oldEventInfo['significantChangeHash'] !== $eventInfo['significantChangeHash']; foreach ($attendee['newInstances'] as $instanceId => $instanceInfo) { @@ -816,7 +820,10 @@ class Broker $instances = []; $exdate = []; + $significantChangeEventProperties = []; + foreach ($calendar->VEVENT as $vevent) { + $eventSignificantChangeHash = ''; $rrule = []; if (is_null($uid)) { @@ -930,19 +937,26 @@ class Broker if (isset($vevent->$prop)) { $propertyValues = $vevent->select($prop); - $significantChangeHash .= $prop.':'; + $eventSignificantChangeHash .= $prop.':'; if ('EXDATE' === $prop) { - $significantChangeHash .= implode(',', $exdate).';'; + $eventSignificantChangeHash .= implode(',', $exdate).';'; } elseif ('RRULE' === $prop) { - $significantChangeHash .= implode(',', $rrule).';'; + $eventSignificantChangeHash .= implode(',', $rrule).';'; } else { foreach ($propertyValues as $val) { - $significantChangeHash .= $val->getValue().';'; + $eventSignificantChangeHash .= $val->getValue().';'; } } } } + $significantChangeEventProperties[] = $eventSignificantChangeHash; + } + + asort($significantChangeEventProperties); + + foreach ($significantChangeEventProperties as $eventSignificantChangeHash) { + $significantChangeHash .= $eventSignificantChangeHash; } $significantChangeHash = md5($significantChangeHash); diff --git a/vendor/sabre/vobject/lib/Node.php b/vendor/sabre/vobject/lib/Node.php index 4c0c04f72..2041b2ac7 100644 --- a/vendor/sabre/vobject/lib/Node.php +++ b/vendor/sabre/vobject/lib/Node.php @@ -73,6 +73,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @return array */ + #[\ReturnTypeWillChange] abstract public function jsonSerialize(); /** @@ -102,6 +103,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @return ElementList */ + #[\ReturnTypeWillChange] public function getIterator() { if (!is_null($this->iterator)) { @@ -157,6 +159,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @return int */ + #[\ReturnTypeWillChange] public function count() { $it = $this->getIterator(); @@ -177,6 +180,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($offset) { $iterator = $this->getIterator(); @@ -193,6 +197,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { $iterator = $this->getIterator(); @@ -208,6 +213,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * @param int $offset * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { $iterator = $this->getIterator(); @@ -228,6 +234,7 @@ abstract class Node implements \IteratorAggregate, \ArrayAccess, \Countable, \Js * * @param int $offset */ + #[\ReturnTypeWillChange] public function offsetUnset($offset) { $iterator = $this->getIterator(); diff --git a/vendor/sabre/vobject/lib/Parameter.php b/vendor/sabre/vobject/lib/Parameter.php index 72f2ecbcb..7e4d55743 100644 --- a/vendor/sabre/vobject/lib/Parameter.php +++ b/vendor/sabre/vobject/lib/Parameter.php @@ -321,6 +321,7 @@ class Parameter extends Node * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { return $this->value; @@ -354,6 +355,7 @@ class Parameter extends Node * * @return ElementList */ + #[\ReturnTypeWillChange] public function getIterator() { if (!is_null($this->iterator)) { diff --git a/vendor/sabre/vobject/lib/Parser/MimeDir.php b/vendor/sabre/vobject/lib/Parser/MimeDir.php index 385d340d7..db0f81531 100644 --- a/vendor/sabre/vobject/lib/Parser/MimeDir.php +++ b/vendor/sabre/vobject/lib/Parser/MimeDir.php @@ -439,7 +439,7 @@ class MimeDir extends Parser $propObj->add(null, $namelessParameter); } - if ('QUOTED-PRINTABLE' === strtoupper($propObj['ENCODING'])) { + if (isset($propObj['ENCODING']) && 'QUOTED-PRINTABLE' === strtoupper($propObj['ENCODING'])) { $propObj->setQuotedPrintableValue($this->extractQuotedPrintableValue()); } else { $charset = $this->charset; @@ -518,7 +518,7 @@ class MimeDir extends Parser * * 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. * diff --git a/vendor/sabre/vobject/lib/Property.php b/vendor/sabre/vobject/lib/Property.php index f9cf8e38e..50cda9684 100644 --- a/vendor/sabre/vobject/lib/Property.php +++ b/vendor/sabre/vobject/lib/Property.php @@ -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 = ';'; @@ -276,6 +276,7 @@ abstract class Property extends Node * * @return array */ + #[\ReturnTypeWillChange] public function jsonSerialize() { $parameters = []; @@ -387,6 +388,7 @@ abstract class Property extends Node * * @return bool */ + #[\ReturnTypeWillChange] public function offsetExists($name) { if (is_int($name)) { @@ -413,6 +415,7 @@ abstract class Property extends Node * * @return Node */ + #[\ReturnTypeWillChange] public function offsetGet($name) { if (is_int($name)) { @@ -433,6 +436,7 @@ abstract class Property extends Node * @param string $name * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($name, $value) { if (is_int($name)) { @@ -453,6 +457,7 @@ abstract class Property extends Node * * @param string $name */ + #[\ReturnTypeWillChange] public function offsetUnset($name) { if (is_int($name)) { diff --git a/vendor/sabre/vobject/lib/Property/Binary.php b/vendor/sabre/vobject/lib/Property/Binary.php index ec6713fdd..1262dd054 100644 --- a/vendor/sabre/vobject/lib/Property/Binary.php +++ b/vendor/sabre/vobject/lib/Property/Binary.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/FloatValue.php b/vendor/sabre/vobject/lib/Property/FloatValue.php index 0d0346968..e780ae6c1 100644 --- a/vendor/sabre/vobject/lib/Property/FloatValue.php +++ b/vendor/sabre/vobject/lib/Property/FloatValue.php @@ -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 = ';'; diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php b/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php index 86be66c15..2dbbc6eaf 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/CalAddress.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php index d635e17ae..ca71633b9 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php @@ -300,6 +300,7 @@ class DateTime extends Property * @param string $name * @param mixed $value */ + #[\ReturnTypeWillChange] public function offsetSet($name, $value) { parent::offsetSet($name, $value); diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php index 87f008160..e18fe191e 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Duration.php @@ -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 = ','; diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php index eb3752770..ae8a78911 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Period.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Period.php @@ -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 = ','; diff --git a/vendor/sabre/vobject/lib/Property/Time.php b/vendor/sabre/vobject/lib/Property/Time.php index 544b5ced3..1b81609aa 100644 --- a/vendor/sabre/vobject/lib/Property/Time.php +++ b/vendor/sabre/vobject/lib/Property/Time.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/Uri.php b/vendor/sabre/vobject/lib/Property/Uri.php index 830cd3f18..1ad1fb199 100644 --- a/vendor/sabre/vobject/lib/Property/Uri.php +++ b/vendor/sabre/vobject/lib/Property/Uri.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/UtcOffset.php b/vendor/sabre/vobject/lib/Property/UtcOffset.php index 248ed40ea..04b88447f 100644 --- a/vendor/sabre/vobject/lib/Property/UtcOffset.php +++ b/vendor/sabre/vobject/lib/Property/UtcOffset.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php b/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php index 09918b31a..7bf79c48c 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php +++ b/vendor/sabre/vobject/lib/Property/VCard/DateAndOrTime.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php index fccf2d600..da6ea3d44 100644 --- a/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php +++ b/vendor/sabre/vobject/lib/Property/VCard/TimeStamp.php @@ -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. diff --git a/vendor/sabre/vobject/lib/Recur/EventIterator.php b/vendor/sabre/vobject/lib/Recur/EventIterator.php index e42ca1360..61f05d7de 100644 --- a/vendor/sabre/vobject/lib/Recur/EventIterator.php +++ b/vendor/sabre/vobject/lib/Recur/EventIterator.php @@ -198,6 +198,7 @@ class EventIterator implements \Iterator * * @return DateTimeImmutable */ + #[\ReturnTypeWillChange] public function current() { if ($this->currentDate) { @@ -229,9 +230,13 @@ class EventIterator implements \Iterator if (!$this->valid()) { return; } - $end = clone $this->currentDate; + if ($this->currentOverriddenEvent && $this->currentOverriddenEvent->DTEND) { + return $this->currentOverriddenEvent->DTEND->getDateTime($this->timeZone); + } else { + $end = clone $this->currentDate; - return $end->modify('+'.$this->eventDuration.' seconds'); + return $end->modify('+'.$this->eventDuration.' seconds'); + } } /** @@ -281,6 +286,7 @@ class EventIterator implements \Iterator * * @return int */ + #[\ReturnTypeWillChange] public function key() { // The counter is always 1 ahead. @@ -293,6 +299,7 @@ class EventIterator implements \Iterator * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { if ($this->counter > Settings::$maxRecurrences && -1 !== Settings::$maxRecurrences) { @@ -304,7 +311,10 @@ class EventIterator implements \Iterator /** * Sets the iterator back to the starting point. + * + * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->recurIterator->rewind(); @@ -327,7 +337,10 @@ class EventIterator implements \Iterator /** * Advances the iterator with one step. + * + * @return void */ + #[\ReturnTypeWillChange] public function next() { $this->currentOverriddenEvent = null; diff --git a/vendor/sabre/vobject/lib/Recur/RDateIterator.php b/vendor/sabre/vobject/lib/Recur/RDateIterator.php index d117e152c..5d56657fa 100644 --- a/vendor/sabre/vobject/lib/Recur/RDateIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RDateIterator.php @@ -35,6 +35,7 @@ class RDateIterator implements Iterator /* Implementation of the Iterator interface {{{ */ + #[\ReturnTypeWillChange] public function current() { if (!$this->valid()) { @@ -49,6 +50,7 @@ class RDateIterator implements Iterator * * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->counter; @@ -60,6 +62,7 @@ class RDateIterator implements Iterator * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { return $this->counter <= count($this->dates); @@ -67,7 +70,10 @@ class RDateIterator implements Iterator /** * Resets the iterator. + * + * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->currentDate = clone $this->startDate; @@ -76,7 +82,10 @@ class RDateIterator implements Iterator /** * Goes on to the next iteration. + * + * @return void */ + #[\ReturnTypeWillChange] public function next() { ++$this->counter; diff --git a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php index 0511f0ade..d556aa6c3 100644 --- a/vendor/sabre/vobject/lib/Recur/RRuleIterator.php +++ b/vendor/sabre/vobject/lib/Recur/RRuleIterator.php @@ -38,6 +38,7 @@ class RRuleIterator implements Iterator /* Implementation of the Iterator interface {{{ */ + #[\ReturnTypeWillChange] public function current() { if (!$this->valid()) { @@ -52,6 +53,7 @@ class RRuleIterator implements Iterator * * @return int */ + #[\ReturnTypeWillChange] public function key() { return $this->counter; @@ -64,6 +66,7 @@ class RRuleIterator implements Iterator * * @return bool */ + #[\ReturnTypeWillChange] public function valid() { if (null === $this->currentDate) { @@ -78,7 +81,10 @@ class RRuleIterator implements Iterator /** * Resets the iterator. + * + * @return void */ + #[\ReturnTypeWillChange] public function rewind() { $this->currentDate = clone $this->startDate; @@ -87,7 +93,10 @@ class RRuleIterator implements Iterator /** * Goes on to the next iteration. + * + * @return void */ + #[\ReturnTypeWillChange] public function next() { // Otherwise, we find the next event in the normal RRULE diff --git a/vendor/sabre/vobject/lib/TimeZoneUtil.php b/vendor/sabre/vobject/lib/TimeZoneUtil.php index 2c407fee6..6422c0930 100644 --- a/vendor/sabre/vobject/lib/TimeZoneUtil.php +++ b/vendor/sabre/vobject/lib/TimeZoneUtil.php @@ -2,6 +2,16 @@ namespace Sabre\VObject; +use DateTimeZone; +use InvalidArgumentException; +use Sabre\VObject\TimezoneGuesser\FindFromOffset; +use Sabre\VObject\TimezoneGuesser\FindFromTimezoneIdentifier; +use Sabre\VObject\TimezoneGuesser\FindFromTimezoneMap; +use Sabre\VObject\TimezoneGuesser\GuessFromLicEntry; +use Sabre\VObject\TimezoneGuesser\GuessFromMsTzId; +use Sabre\VObject\TimezoneGuesser\TimezoneFinder; +use Sabre\VObject\TimezoneGuesser\TimezoneGuesser; + /** * Time zone name translation. * @@ -14,17 +24,136 @@ namespace Sabre\VObject; */ class TimeZoneUtil { + /** @var self */ + private static $instance = null; + + /** @var TimezoneGuesser[] */ + private $timezoneGuessers = []; + + /** @var TimezoneFinder[] */ + private $timezoneFinders = []; + + private function __construct() + { + $this->addGuesser('lic', new GuessFromLicEntry()); + $this->addGuesser('msTzId', new GuessFromMsTzId()); + $this->addFinder('tzid', new FindFromTimezoneIdentifier()); + $this->addFinder('tzmap', new FindFromTimezoneMap()); + $this->addFinder('offset', new FindFromOffset()); + } + + private static function getInstance(): self + { + if (null === self::$instance) { + self::$instance = new self(); + } + + return self::$instance; + } + + private function addGuesser(string $key, TimezoneGuesser $guesser): void + { + $this->timezoneGuessers[$key] = $guesser; + } + + private function addFinder(string $key, TimezoneFinder $finder): void + { + $this->timezoneFinders[$key] = $finder; + } + + /** + * This method will try to find out the correct timezone for an iCalendar + * date-time value. + * + * You must pass the contents of the TZID parameter, as well as the full + * calendar. + * + * If the lookup fails, this method will return the default PHP timezone + * (as configured using date_default_timezone_set, or the date.timezone ini + * setting). + * + * Alternatively, if $failIfUncertain is set to true, it will throw an + * exception if we cannot accurately determine the timezone. + */ + private function findTimeZone(string $tzid, Component $vcalendar = null, bool $failIfUncertain = false): DateTimeZone + { + foreach ($this->timezoneFinders as $timezoneFinder) { + $timezone = $timezoneFinder->find($tzid, $failIfUncertain); + if (!$timezone instanceof DateTimeZone) { + continue; + } + + return $timezone; + } + + if ($vcalendar) { + // If that didn't work, we will scan VTIMEZONE objects + foreach ($vcalendar->select('VTIMEZONE') as $vtimezone) { + if ((string) $vtimezone->TZID === $tzid) { + foreach ($this->timezoneGuessers as $timezoneGuesser) { + $timezone = $timezoneGuesser->guess($vtimezone, $failIfUncertain); + if (!$timezone instanceof DateTimeZone) { + continue; + } + + return $timezone; + } + } + } + } + + if ($failIfUncertain) { + throw new InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: '.$tzid); + } + + // If we got all the way here, we default to whatever has been set as the PHP default timezone. + return new DateTimeZone(date_default_timezone_get()); + } + + public static function addTimezoneGuesser(string $key, TimezoneGuesser $guesser): void + { + self::getInstance()->addGuesser($key, $guesser); + } + + public static function addTimezoneFinder(string $key, TimezoneFinder $finder): void + { + self::getInstance()->addFinder($key, $finder); + } + + /** + * @param string $tzid + * @param false $failIfUncertain + * + * @return DateTimeZone + */ + public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) + { + return self::getInstance()->findTimeZone($tzid, $vcalendar, $failIfUncertain); + } + + public static function clean(): void + { + self::$instance = null; + } + + // Keeping things for backwards compatibility + /** + * @var array|null + * + * @deprecated + */ public static $map = null; /** * List of microsoft exchange timezone ids. * * Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx + * + * @deprecated */ public static $microsoftExchangeMap = [ 0 => 'UTC', 31 => 'Africa/Casablanca', - // Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo. // I'm not even kidding.. We handle this special case in the // getTimeZone method. @@ -104,134 +233,10 @@ class TimeZoneUtil ]; /** - * This method will try to find out the correct timezone for an iCalendar - * date-time value. - * - * You must pass the contents of the TZID parameter, as well as the full - * calendar. - * - * If the lookup fails, this method will return the default PHP timezone - * (as configured using date_default_timezone_set, or the date.timezone ini - * setting). - * - * Alternatively, if $failIfUncertain is set to true, it will throw an - * exception if we cannot accurately determine the timezone. - * - * @param string $tzid - * @param Sabre\VObject\Component $vcalendar - * - * @return \DateTimeZone - */ - public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) - { - // First we will just see if the tzid is a support timezone identifier. - // - // The only exception is if the timezone starts with (. This is to - // handle cases where certain microsoft products generate timezone - // identifiers that for instance look like: - // - // (GMT+01.00) Sarajevo/Warsaw/Zagreb - // - // Since PHP 5.5.10, the first bit will be used as the timezone and - // this method will return just GMT+01:00. This is wrong, because it - // doesn't take DST into account. - if ('(' !== $tzid[0]) { - // PHP has a bug that logs PHP warnings even it shouldn't: - // https://bugs.php.net/bug.php?id=67881 - // - // That's why we're checking if we'll be able to successfully instantiate - // \DateTimeZone() before doing so. Otherwise we could simply instantiate - // and catch the exception. - $tzIdentifiers = \DateTimeZone::listIdentifiers(); - - try { - if ( - (in_array($tzid, $tzIdentifiers)) || - (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) || - (in_array($tzid, self::getIdentifiersBC())) - ) { - return new \DateTimeZone($tzid); - } - } catch (\Exception $e) { - } - } - - self::loadTzMaps(); - - // Next, we check if the tzid is somewhere in our tzid map. - if (isset(self::$map[$tzid])) { - return new \DateTimeZone(self::$map[$tzid]); - } - - // Some Microsoft products prefix the offset first, so let's strip that off - // and see if it is our tzid map. We don't want to check for this first just - // in case there are overrides in our tzid map. - if (preg_match('/^\((UTC|GMT)(\+|\-)[\d]{2}\:[\d]{2}\) (.*)/', $tzid, $matches)) { - $tzidAlternate = $matches[3]; - if (isset(self::$map[$tzidAlternate])) { - return new \DateTimeZone(self::$map[$tzidAlternate]); - } - } - - // Maybe the author was hyper-lazy and just included an offset. We - // support it, but we aren't happy about it. - if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) { - // Note that the path in the source will never be taken from PHP 5.5.10 - // onwards. PHP 5.5.10 supports the "GMT+0100" style of format, so it - // already gets returned early in this function. Once we drop support - // for versions under PHP 5.5.10, this bit can be taken out of the - // source. - // @codeCoverageIgnoreStart - return new \DateTimeZone('Etc/GMT'.$matches[1].ltrim(substr($matches[2], 0, 2), '0')); - // @codeCoverageIgnoreEnd - } - - if ($vcalendar) { - // If that didn't work, we will scan VTIMEZONE objects - foreach ($vcalendar->select('VTIMEZONE') as $vtimezone) { - if ((string) $vtimezone->TZID === $tzid) { - // Some clients add 'X-LIC-LOCATION' with the olson name. - if (isset($vtimezone->{'X-LIC-LOCATION'})) { - $lic = (string) $vtimezone->{'X-LIC-LOCATION'}; - - // Libical generators may specify strings like - // "SystemV/EST5EDT". For those we must remove the - // SystemV part. - if ('SystemV/' === substr($lic, 0, 8)) { - $lic = substr($lic, 8); - } - - return self::getTimeZone($lic, null, $failIfUncertain); - } - // Microsoft may add a magic number, which we also have an - // answer for. - if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) { - $cdoId = (int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->getValue(); - - // 2 can mean both Europe/Lisbon and Europe/Sarajevo. - if (2 === $cdoId && false !== strpos((string) $vtimezone->TZID, 'Sarajevo')) { - return new \DateTimeZone('Europe/Sarajevo'); - } - - if (isset(self::$microsoftExchangeMap[$cdoId])) { - return new \DateTimeZone(self::$microsoftExchangeMap[$cdoId]); - } - } - } - } - } - - if ($failIfUncertain) { - throw new \InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: '.$tzid); - } - - // If we got all the way here, we default to UTC. - return new \DateTimeZone(date_default_timezone_get()); - } - - /** * This method will load in all the tz mapping information, if it's not yet * done. + * + * @deprecated */ public static function loadTzMaps() { @@ -257,6 +262,8 @@ class TimeZoneUtil * (See timezonedata/php-bc.php and timezonedata php-workaround.php) * * @return array + * + * @deprecated */ public static function getIdentifiersBC() { diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromOffset.php b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromOffset.php new file mode 100644 index 000000000..990ac9692 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromOffset.php @@ -0,0 +1,31 @@ +<?php + +declare(strict_types=1); + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; + +/** + * Some clients add 'X-LIC-LOCATION' with the olson name. + */ +class FindFromOffset implements TimezoneFinder +{ + public function find(string $tzid, bool $failIfUncertain = false): ?DateTimeZone + { + // Maybe the author was hyper-lazy and just included an offset. We + // support it, but we aren't happy about it. + if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) { + // Note that the path in the source will never be taken from PHP 5.5.10 + // onwards. PHP 5.5.10 supports the "GMT+0100" style of format, so it + // already gets returned early in this function. Once we drop support + // for versions under PHP 5.5.10, this bit can be taken out of the + // source. + // @codeCoverageIgnoreStart + return new DateTimeZone('Etc/GMT'.$matches[1].ltrim(substr($matches[2], 0, 2), '0')); + // @codeCoverageIgnoreEnd + } + + return null; + } +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php new file mode 100644 index 000000000..d8c6d5d3b --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneIdentifier.php @@ -0,0 +1,71 @@ +<?php + +declare(strict_types=1); + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; +use Exception; + +/** + * Some clients add 'X-LIC-LOCATION' with the olson name. + */ +class FindFromTimezoneIdentifier implements TimezoneFinder +{ + public function find(string $tzid, bool $failIfUncertain = false): ?DateTimeZone + { + // First we will just see if the tzid is a support timezone identifier. + // + // The only exception is if the timezone starts with (. This is to + // handle cases where certain microsoft products generate timezone + // identifiers that for instance look like: + // + // (GMT+01.00) Sarajevo/Warsaw/Zagreb + // + // Since PHP 5.5.10, the first bit will be used as the timezone and + // this method will return just GMT+01:00. This is wrong, because it + // doesn't take DST into account + if (!isset($tzid[0])) { + return null; + } + if ('(' === $tzid[0]) { + return null; + } + // PHP has a bug that logs PHP warnings even it shouldn't: + // https://bugs.php.net/bug.php?id=67881 + // + // That's why we're checking if we'll be able to successfully instantiate + // \DateTimeZone() before doing so. Otherwise we could simply instantiate + // and catch the exception. + $tzIdentifiers = DateTimeZone::listIdentifiers(); + + try { + if ( + (in_array($tzid, $tzIdentifiers)) || + (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) || + (in_array($tzid, $this->getIdentifiersBC())) + ) { + return new DateTimeZone($tzid); + } + } catch (Exception $e) { + } + + return null; + } + + /** + * This method returns an array of timezone identifiers, that are supported + * by DateTimeZone(), but not returned by DateTimeZone::listIdentifiers(). + * + * We're not using DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC) because: + * - It's not supported by some PHP versions as well as HHVM. + * - It also returns identifiers, that are invalid values for new DateTimeZone() on some PHP versions. + * (See timezonedata/php-bc.php and timezonedata php-workaround.php) + * + * @return array + */ + private function getIdentifiersBC() + { + return include __DIR__.'/../timezonedata/php-bc.php'; + } +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneMap.php b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneMap.php new file mode 100644 index 000000000..b52ba6a19 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/FindFromTimezoneMap.php @@ -0,0 +1,78 @@ +<?php + +declare(strict_types=1); + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; + +/** + * Some clients add 'X-LIC-LOCATION' with the olson name. + */ +class FindFromTimezoneMap implements TimezoneFinder +{ + private $map = []; + + private $patterns = [ + '/^\((UTC|GMT)(\+|\-)[\d]{2}\:[\d]{2}\) (.*)/', + '/^\((UTC|GMT)(\+|\-)[\d]{2}\.[\d]{2}\) (.*)/', + ]; + + public function find(string $tzid, bool $failIfUncertain = false): ?DateTimeZone + { + // Next, we check if the tzid is somewhere in our tzid map. + if ($this->hasTzInMap($tzid)) { + return new DateTimeZone($this->getTzFromMap($tzid)); + } + + // Some Microsoft products prefix the offset first, so let's strip that off + // and see if it is our tzid map. We don't want to check for this first just + // in case there are overrides in our tzid map. + foreach ($this->patterns as $pattern) { + if (!preg_match($pattern, $tzid, $matches)) { + continue; + } + $tzidAlternate = $matches[3]; + if ($this->hasTzInMap($tzidAlternate)) { + return new DateTimeZone($this->getTzFromMap($tzidAlternate)); + } + } + + return null; + } + + /** + * This method returns an array of timezone identifiers, that are supported + * by DateTimeZone(), but not returned by DateTimeZone::listIdentifiers(). + * + * We're not using DateTimeZone::listIdentifiers(DateTimeZone::ALL_WITH_BC) because: + * - It's not supported by some PHP versions as well as HHVM. + * - It also returns identifiers, that are invalid values for new DateTimeZone() on some PHP versions. + * (See timezonedata/php-bc.php and timezonedata php-workaround.php) + * + * @return array + */ + private function getTzMaps() + { + if ([] === $this->map) { + $this->map = array_merge( + include __DIR__.'/../timezonedata/windowszones.php', + include __DIR__.'/../timezonedata/lotuszones.php', + include __DIR__.'/../timezonedata/exchangezones.php', + include __DIR__.'/../timezonedata/php-workaround.php' + ); + } + + return $this->map; + } + + private function getTzFromMap(string $tzid): string + { + return $this->getTzMaps()[$tzid]; + } + + private function hasTzInMap(string $tzid): bool + { + return isset($this->getTzMaps()[$tzid]); + } +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php new file mode 100644 index 000000000..f340a3962 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromLicEntry.php @@ -0,0 +1,33 @@ +<?php + +declare(strict_types=1); + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; +use Sabre\VObject\Component\VTimeZone; +use Sabre\VObject\TimeZoneUtil; + +/** + * Some clients add 'X-LIC-LOCATION' with the olson name. + */ +class GuessFromLicEntry implements TimezoneGuesser +{ + public function guess(VTimeZone $vtimezone, bool $failIfUncertain = false): ?DateTimeZone + { + if (!isset($vtimezone->{'X-LIC-LOCATION'})) { + return null; + } + + $lic = (string) $vtimezone->{'X-LIC-LOCATION'}; + + // Libical generators may specify strings like + // "SystemV/EST5EDT". For those we must remove the + // SystemV part. + if ('SystemV/' === substr($lic, 0, 8)) { + $lic = substr($lic, 8); + } + + return TimeZoneUtil::getTimeZone($lic, null, $failIfUncertain); + } +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromMsTzId.php b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromMsTzId.php new file mode 100644 index 000000000..b11ce1832 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/GuessFromMsTzId.php @@ -0,0 +1,119 @@ +<?php + +declare(strict_types=1); + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; +use Sabre\VObject\Component\VTimeZone; + +class GuessFromMsTzId implements TimezoneGuesser +{ + /** + * List of microsoft exchange timezone ids. + * + * Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx + */ + public static $microsoftExchangeMap = [ + 0 => 'UTC', + 31 => 'Africa/Casablanca', + + // Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo. + // I'm not even kidding.. We handle this special case in the + // getTimeZone method. + 2 => 'Europe/Lisbon', + 1 => 'Europe/London', + 4 => 'Europe/Berlin', + 6 => 'Europe/Prague', + 3 => 'Europe/Paris', + 69 => 'Africa/Luanda', // This was a best guess + 7 => 'Europe/Athens', + 5 => 'Europe/Bucharest', + 49 => 'Africa/Cairo', + 50 => 'Africa/Harare', + 59 => 'Europe/Helsinki', + 27 => 'Asia/Jerusalem', + 26 => 'Asia/Baghdad', + 74 => 'Asia/Kuwait', + 51 => 'Europe/Moscow', + 56 => 'Africa/Nairobi', + 25 => 'Asia/Tehran', + 24 => 'Asia/Muscat', // Best guess + 54 => 'Asia/Baku', + 48 => 'Asia/Kabul', + 58 => 'Asia/Yekaterinburg', + 47 => 'Asia/Karachi', + 23 => 'Asia/Calcutta', + 62 => 'Asia/Kathmandu', + 46 => 'Asia/Almaty', + 71 => 'Asia/Dhaka', + 66 => 'Asia/Colombo', + 61 => 'Asia/Rangoon', + 22 => 'Asia/Bangkok', + 64 => 'Asia/Krasnoyarsk', + 45 => 'Asia/Shanghai', + 63 => 'Asia/Irkutsk', + 21 => 'Asia/Singapore', + 73 => 'Australia/Perth', + 75 => 'Asia/Taipei', + 20 => 'Asia/Tokyo', + 72 => 'Asia/Seoul', + 70 => 'Asia/Yakutsk', + 19 => 'Australia/Adelaide', + 44 => 'Australia/Darwin', + 18 => 'Australia/Brisbane', + 76 => 'Australia/Sydney', + 43 => 'Pacific/Guam', + 42 => 'Australia/Hobart', + 68 => 'Asia/Vladivostok', + 41 => 'Asia/Magadan', + 17 => 'Pacific/Auckland', + 40 => 'Pacific/Fiji', + 67 => 'Pacific/Tongatapu', + 29 => 'Atlantic/Azores', + 53 => 'Atlantic/Cape_Verde', + 30 => 'America/Noronha', + 8 => 'America/Sao_Paulo', // Best guess + 32 => 'America/Argentina/Buenos_Aires', + 60 => 'America/Godthab', + 28 => 'America/St_Johns', + 9 => 'America/Halifax', + 33 => 'America/Caracas', + 65 => 'America/Santiago', + 35 => 'America/Bogota', + 10 => 'America/New_York', + 34 => 'America/Indiana/Indianapolis', + 55 => 'America/Guatemala', + 11 => 'America/Chicago', + 37 => 'America/Mexico_City', + 36 => 'America/Edmonton', + 38 => 'America/Phoenix', + 12 => 'America/Denver', // Best guess + 13 => 'America/Los_Angeles', // Best guess + 14 => 'America/Anchorage', + 15 => 'Pacific/Honolulu', + 16 => 'Pacific/Midway', + 39 => 'Pacific/Kwajalein', + ]; + + public function guess(VTimeZone $vtimezone, bool $throwIfUnsure = false): ?DateTimeZone + { + // Microsoft may add a magic number, which we also have an + // answer for. + if (!isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) { + return null; + } + $cdoId = (int) $vtimezone->{'X-MICROSOFT-CDO-TZID'}->getValue(); + + // 2 can mean both Europe/Lisbon and Europe/Sarajevo. + if (2 === $cdoId && false !== strpos((string) $vtimezone->TZID, 'Sarajevo')) { + return new DateTimeZone('Europe/Sarajevo'); + } + + if (isset(self::$microsoftExchangeMap[$cdoId])) { + return new DateTimeZone(self::$microsoftExchangeMap[$cdoId]); + } + + return null; + } +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneFinder.php b/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneFinder.php new file mode 100644 index 000000000..5aa880a1c --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneFinder.php @@ -0,0 +1,10 @@ +<?php + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; + +interface TimezoneFinder +{ + public function find(string $tzid, bool $failIfUncertain = false): ?DateTimeZone; +} diff --git a/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneGuesser.php b/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneGuesser.php new file mode 100644 index 000000000..5e193bb52 --- /dev/null +++ b/vendor/sabre/vobject/lib/TimezoneGuesser/TimezoneGuesser.php @@ -0,0 +1,11 @@ +<?php + +namespace Sabre\VObject\TimezoneGuesser; + +use DateTimeZone; +use Sabre\VObject\Component\VTimeZone; + +interface TimezoneGuesser +{ + public function guess(VTimeZone $vtimezone, bool $failIfUncertain = false): ?DateTimeZone; +} diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php index 63452400f..64938bf0b 100644 --- a/vendor/sabre/vobject/lib/Version.php +++ b/vendor/sabre/vobject/lib/Version.php @@ -14,5 +14,5 @@ class Version /** * Full version number. */ - const VERSION = '4.3.5'; + const VERSION = '4.4.1'; } diff --git a/vendor/sabre/xml/.github/workflows/ci.yml b/vendor/sabre/xml/.github/workflows/ci.yml new file mode 100644 index 000000000..3473cd2de --- /dev/null +++ b/vendor/sabre/xml/.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.lock') }} + 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' diff --git a/vendor/sabre/xml/.gitignore b/vendor/sabre/xml/.gitignore deleted file mode 100644 index 9715e9028..000000000 --- a/vendor/sabre/xml/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Composer -vendor -composer.lock - -# Tests -tests/cov -tests/.phpunit.result.cache -.php_cs.cache diff --git a/vendor/sabre/xml/.php_cs.dist b/vendor/sabre/xml/.php_cs.dist deleted file mode 100644 index c5c78a971..000000000 --- a/vendor/sabre/xml/.php_cs.dist +++ /dev/null @@ -1,12 +0,0 @@ -<?php - -$config = PhpCsFixer\Config::create(); -$config->getFinder() - ->exclude('vendor') - ->in(__DIR__); -$config->setRules([ - '@PSR1' => true, - '@Symfony' => true -]); - -return $config;
\ No newline at end of file diff --git a/vendor/sabre/xml/.travis.yml b/vendor/sabre/xml/.travis.yml deleted file mode 100644 index fc4a98d8e..000000000 --- a/vendor/sabre/xml/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -language: php -sudo: required -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - -env: - global: - - RUN_PHPCSFIXER="TRUE" - - RUN_PHPUNIT="TRUE" - - 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: 'PHP8' - dist: focal - php: nightly - env: - - RUN_PHPCSFIXER="FALSE" - - REPORT_COVERAGE="FALSE" - - name: 'PHPStan' - php: 7.4 - env: - - RUN_PHPCSFIXER="FALSE" - - RUN_PHPUNIT="FALSE" - - RUN_PHPSTAN="TRUE" - - REPORT_COVERAGE="FALSE" - fast_finish: true - -cache: - directories: - - $HOME/.composer/cache - -before_script: - - if [ $RUN_PHPCSFIXER == "FALSE" ]; then composer remove --dev friendsofphp/php-cs-fixer; fi - - composer update $PREFER_LOWEST - -script: - - if [ $RUN_PHPCSFIXER == "TRUE" ]; then php vendor/bin/php-cs-fixer fix --dry-run --diff; fi - - if [ $RUN_PHPUNIT == "TRUE" ]; then php vendor/bin/phpunit --configuration tests/phpunit.xml $WITH_COVERAGE; fi - - if [ $RUN_PHPSTAN == "TRUE" ]; then composer phpstan; fi - -after_success: - - if [ $REPORT_COVERAGE == "TRUE" ]; then bash <(curl -s https://codecov.io/bash); fi diff --git a/vendor/sabre/xml/CHANGELOG.md b/vendor/sabre/xml/CHANGELOG.md deleted file mode 100644 index cdd21fe51..000000000 --- a/vendor/sabre/xml/CHANGELOG.md +++ /dev/null @@ -1,287 +0,0 @@ -ChangeLog -========= - -2.2.3 (2020-10-03) ------------------- -* #191: add changelog and version bump that was missed in 2.2.2 - -2.2.2 (2020-10-03) ------------------- -* #190: adjust libxml_disable_entity_loader calls ready for PHP 8.0 (@phil-davis) - -2.2.1 (2020-05-11) ------------------- - -* #183: fixed warning 'xml cannot be empty while reading', which might lead to a infinite-loop (@mrow4a) -* #179, #178, #177 #176: several build/continous integration related improvements (@phil-davis) - -2.2.0 (2020-01-31) ------------------- - -* #171: Added Support for PHP 7.4, dropped Support for PHP 7.0 (@staabm, @phil-davis) -* #174: Update testsuite to phpunit8 (@phil-davis) -* Added phpstan coverage (@phil-davis) -* #144: Added a new `functionCaller` deserializer function for executing a callable when reading a XML -element (@vsouz4) - - -2.1.3 (2019-08-14) ------------------- - -* #166: Throw exception when empty inputs found - - -2.1.2 (2019-01-09) ------------------- - -* #161: Prevent infinite loop on empty xml elements - - -2.1.1 (2018-10-09) ------------------- - -* #149: Properly detect xml parse errors in `parseCurrentElement()` edge-cases - - -2.1.0 (2018-02-08) ------------------- - -* #112: Added a `mixedContent` deserializer function, which might be useful - if you're parsing HTML-like documents with elements that contain both text - and other elements as siblings. (@staabm). - - -2.0.0 (2016-11-15) ------------------- - -* Now requires PHP 7. -* Uses typehints everywhere. -* Fixed some minor strict typing-related issues. -* Removed workaround for PHP bug [64230](https://bugs.php.net/bug.php?id=64230). - - -1.5.0 (2016-10-09) ------------------- - -* Now requires PHP 5.5. -* Using `finally` to always roll back the context stack when serializing. -* #94: Fixed an infinite loop condition when reading some invalid XML - documents. - - -1.4.2 (2016-05-19) ------------------- - -* The `contextStack` in the Reader object is now correctly rolled back in - error conditions (@staabm). -* repeatingElements deserializer now still parses if a bare element name - without clark notation was given. -* `$elementMap` in the Reader now also supports bare element names. -* `Service::expect()` can now also work with bare element names. - - -1.4.1 (2016-03-12) ------------------ - -* Parsing clark-notation is now cached. This can speed up parsing large - documents with lots of repeating elements a fair bit. (@icewind1991). - - -1.4.0 (2016-02-14) ------------------- - -* Any array thrown into the serializer with numeric keys is now simply - traversed and each individual item is serialized. This fixes an issue - related to serializing value objects with array children. -* When serializing value objects, properties that have a null value or an - empty array are now skipped. We believe this to be the saner default, but - does constitute a BC break for those depending on this. -* Serializing array properties in value objects was broken. - - -1.3.0 (2015-12-29) ------------------- - -* The `Service` class adds a new `mapValueObject` method which provides basic - capabilities to map between ValueObjects and XML. -* #61: You can now specify serializers for specific classes, allowing you - separate the object you want to serialize from the serializer. This uses the - `$classMap` property which is defined on both the `Service` and `Writer`. -* It's now possible to pass an array of possible root elements to - `Sabre\Xml\Service::expect()`. -* Moved some parsing logic to `Reader::getDeserializerForElementName()`, - so people with more advanced use-cases can implement their own logic there. -* #63: When serializing elements using arrays, the `value` key in the array is - now optional. -* #62: Added a `keyValue` deserializer function. This can be used instead of - the `Element\KeyValue` class and is a lot more flexible. (@staabm) -* Also added an `enum` deserializer function to replace - `Element\Elements`. -* Using an empty string for a namespace prefix now has the same effect as - `null`. - - -1.2.0 (2015-08-30) ------------------- - -* #53: Added `parseGetElements`, a function like `parseInnerTree`, except - that it always returns an array of elements, or an empty array. - - -1.1.0 (2015-06-29) ------------------- - -* #44, #45: Catching broken and invalid XML better and throwing - `Sabre\Xml\LibXMLException` whenever we encounter errors. (@stefanmajoor, - @DaanBiesterbos) - - -1.0.0 (2015-05-25) ------------------- - -* No functional changes since 0.4.3. Marking it as 1.0.0 as a promise for - API stability. -* Using php-cs-fixer for automated CS enforcement. - - -0.4.3 (2015-04-01) ------------------ - -* Minor tweaks for the public release. - - -0.4.2 (2015-03-20) ------------------- - -* Removed `constants.php` again. They messed with PHPUnit and don't really - provide a great benefit. -* #41: Correctly handle self-closing xml elements. - - -0.4.1 (2015-03-19) ------------------- - -* #40: An element with an empty namespace (xmlns="") is not allowed to have a - prefix. This is now fixed. - - -0.4.0 (2015-03-18) ------------------- - -* Added `Sabre\Xml\Service`. This is intended as a simple way to centrally - configure xml applications and easily parse/write things from there. #35, #38. -* Renamed 'baseUri' to 'contextUri' everywhere. -* #36: Added a few convenience constants to `lib/constants.php`. -* `Sabre\Xml\Util::parseClarkNotation` is now in the `Sabre\Xml\Service` class. - - -0.3.1 (2015-02-08) ------------------- - -* Added `XmlDeserializable` to match `XmlSerializable`. - - -0.3.0 (2015-02-06) ------------------- - -* Added `$elementMap` argument to parseInnerTree, for quickly overriding - parsing rules within an element. - - -0.2.2 (2015-02-05) ------------------- - -* Now depends on sabre/uri 1.0. - - -0.2.1 (2014-12-17) ------------------- - -* LibXMLException now inherits from ParseException, so it's easy for users to - catch any exception thrown by the parser. - - -0.2.0 (2014-12-05) ------------------- - -* Major BC Break: method names for the Element interface have been renamed - from `serializeXml` and `deserializeXml` to `xmlSerialize` and - `xmlDeserialize`. This is so that it matches PHP's `JsonSerializable` - interface. -* #25: Added `XmlSerializable` to allow people to write serializers without - having to implement a deserializer in the same class. -* #26: Renamed the `Sabre\XML` namespace to `Sabre\Xml`. Due to composer magic - and the fact that PHP namespace are case-insensitive, this should not affect - anyone, unless you are doing exact string matches on class names. -* #23: It's not possible to automatically extract or serialize Xml fragments - from documents using `Sabre\Xml\Element\XmlFragment`. - - -0.1.0 (2014-11-24) ------------------- - -* #16: Added ability to override `elementMap`, `namespaceMap` and `baseUri` for - a fragment of a document during reading an writing using `pushContext` and - `popContext`. -* Removed: `Writer::$context` and `Reader::$context`. -* #15: Added `Reader::$baseUri` to match `Writer::$baseUri`. -* #20: Allow callbacks to be used instead of `Element` classes in the `Reader`. -* #25: Added `readText` to quickly grab all text from a node and advance the - reader to the next node. -* #15: Added `Sabre\XML\Element\Uri`. - - -0.0.6 (2014-09-26) ------------------- - -* Added: `CData` element. -* #13: Better support for xml with no namespaces. (@kalmas) -* Switched to PSR-4 directory structure. - - -0.0.5 (2013-03-27) ------------------- - -* Added: baseUri property to the Writer class. -* Added: The writeElement method can now write complex elements. -* Added: Throwing exception when invalid objects are written. - - -0.0.4 (2013-03-14) ------------------- - -* Fixed: The KeyValue parser was skipping over elements when there was no - whitespace between them. -* Fixed: Clearing libxml errors after parsing. -* Added: Support for CDATA. -* Added: Context properties. - - -0.0.3 (2013-02-22) ------------------- - -* Changed: Reader::parse returns an array with 1 level less depth. -* Added: A LibXMLException is now thrown if the XMLReader comes across an error. -* Fixed: Both the Elements and KeyValue parsers had severe issues with - nesting. -* Fixed: The reader now detects when the end of the document is hit before it - should (because we're still parsing an element). - - -0.0.2 (2013-02-17) ------------------- - -* Added: Elements parser. -* Added: KeyValue parser. -* Change: Reader::parseSubTree is now named parseInnerTree, and returns either - a string (in case of a text-node), or an array (in case there were child - elements). -* Added: Reader::parseCurrentElement is now public. - - -0.0.1 (2013-02-07) ------------------- - -* First alpha release - -Project started: 2012-11-13. First experiments in June 2009. diff --git a/vendor/sabre/xml/composer.json b/vendor/sabre/xml/composer.json index b54cf195b..4524cf59b 100644 --- a/vendor/sabre/xml/composer.json +++ b/vendor/sabre/xml/composer.json @@ -44,7 +44,7 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.16.1", + "friendsofphp/php-cs-fixer": "~2.17.1", "phpstan/phpstan": "^0.12", "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" }, diff --git a/vendor/sabre/xml/lib/ContextStackTrait.php b/vendor/sabre/xml/lib/ContextStackTrait.php index 757088847..4e15bd414 100644 --- a/vendor/sabre/xml/lib/ContextStackTrait.php +++ b/vendor/sabre/xml/lib/ContextStackTrait.php @@ -10,7 +10,7 @@ namespace Sabre\Xml; * The Context maintains information about a document during either reading or * writing. * - * During this process, it may be neccesary to override this context + * During this process, it may be necessary to override this context * information. * * This trait allows easy access to the context, and allows the end-user to diff --git a/vendor/sabre/xml/lib/Element/Base.php b/vendor/sabre/xml/lib/Element/Base.php index a1ce7ea5a..8a93191b1 100644 --- a/vendor/sabre/xml/lib/Element/Base.php +++ b/vendor/sabre/xml/lib/Element/Base.php @@ -35,7 +35,7 @@ class Base implements Xml\Element } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * @@ -58,7 +58,7 @@ class Base implements Xml\Element /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/vendor/sabre/xml/lib/Element/Cdata.php b/vendor/sabre/xml/lib/Element/Cdata.php index 61d3213ff..1367343ff 100644 --- a/vendor/sabre/xml/lib/Element/Cdata.php +++ b/vendor/sabre/xml/lib/Element/Cdata.php @@ -12,7 +12,7 @@ use Sabre\Xml; * This element allows you to easily inject CDATA. * * Note that we strongly recommend avoiding CDATA nodes, unless you definitely - * know what you're doing, or you're working with unchangable systems that + * know what you're doing, or you're working with unchangeable systems that * require CDATA. * * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/). @@ -37,12 +37,12 @@ class Cdata implements Xml\XmlSerializable } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/vendor/sabre/xml/lib/Element/Elements.php b/vendor/sabre/xml/lib/Element/Elements.php index e51179833..fecce4c75 100644 --- a/vendor/sabre/xml/lib/Element/Elements.php +++ b/vendor/sabre/xml/lib/Element/Elements.php @@ -53,12 +53,12 @@ class Elements implements Xml\Element } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -76,7 +76,7 @@ class Elements implements Xml\Element /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/vendor/sabre/xml/lib/Element/KeyValue.php b/vendor/sabre/xml/lib/Element/KeyValue.php index dacee000a..17448880d 100644 --- a/vendor/sabre/xml/lib/Element/KeyValue.php +++ b/vendor/sabre/xml/lib/Element/KeyValue.php @@ -53,12 +53,12 @@ class KeyValue implements Xml\Element } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -76,7 +76,7 @@ class KeyValue implements Xml\Element /** * The deserialize method is called during xml parsing. * - * This method is called staticly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/vendor/sabre/xml/lib/Element/Uri.php b/vendor/sabre/xml/lib/Element/Uri.php index 2644fbcd7..336212a53 100644 --- a/vendor/sabre/xml/lib/Element/Uri.php +++ b/vendor/sabre/xml/lib/Element/Uri.php @@ -42,12 +42,12 @@ class Uri implements Xml\Element } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/vendor/sabre/xml/lib/Element/XmlFragment.php b/vendor/sabre/xml/lib/Element/XmlFragment.php index 12109e5c9..bf110eaee 100644 --- a/vendor/sabre/xml/lib/Element/XmlFragment.php +++ b/vendor/sabre/xml/lib/Element/XmlFragment.php @@ -48,12 +48,12 @@ class XmlFragment implements Element } /** - * The xmlSerialize metod is called during xml writing. + * The xmlSerialize method is called during xml writing. * * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a @@ -121,7 +121,7 @@ XML; /** * The deserialize method is called during xml parsing. * - * This method is called statictly, this is because in theory this method + * This method is called statically, this is because in theory this method * may be used as a type of constructor, or factory method. * * Often you want to return an instance of the current class, but you are diff --git a/vendor/sabre/xml/lib/LibXMLException.php b/vendor/sabre/xml/lib/LibXMLException.php index ae136f57b..fb074f97d 100644 --- a/vendor/sabre/xml/lib/LibXMLException.php +++ b/vendor/sabre/xml/lib/LibXMLException.php @@ -8,7 +8,7 @@ use LibXMLError; use Throwable; /** - * This exception is thrown when the Readers runs into a parsing error. + * This exception is thrown when the Reader runs into a parsing error. * * This exception effectively wraps 1 or more LibXMLError objects. * diff --git a/vendor/sabre/xml/lib/ParseException.php b/vendor/sabre/xml/lib/ParseException.php index 5980b5fc4..e237b8732 100644 --- a/vendor/sabre/xml/lib/ParseException.php +++ b/vendor/sabre/xml/lib/ParseException.php @@ -4,8 +4,7 @@ declare(strict_types=1); namespace Sabre\Xml; -use - Exception; +use Exception; /** * This is a base exception for any exception related to parsing xml files. diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index 368e8ffd2..7871a74f5 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -56,7 +56,7 @@ class Reader extends XMLReader public function parse(): array { $previousEntityState = null; - $shouldCallLibxmlDisableEntityLoader = (\PHP_VERSION_ID < 80000); + $shouldCallLibxmlDisableEntityLoader = (\LIBXML_VERSION < 20900); if ($shouldCallLibxmlDisableEntityLoader) { $previousEntityState = libxml_disable_entity_loader(true); } @@ -92,11 +92,11 @@ class Reader extends XMLReader /** * parseGetElements parses everything in the current sub-tree, - * and returns a an array of elements. + * and returns an array of elements. * * Each element has a 'name', 'value' and 'attributes' key. * - * If the the element didn't contain sub-elements, an empty array is always + * If the element didn't contain sub-elements, an empty array is always * returned. If there was any text inside the element, it will be * discarded. * @@ -249,7 +249,7 @@ class Reader extends XMLReader * * If the attributes are part of the same namespace, they will simply be * short keys. If they are defined on a different namespace, the attribute - * name will be retured in clark-notation. + * name will be returned in clark-notation. */ public function parseAttributes(): array { @@ -275,7 +275,7 @@ class Reader extends XMLReader /** * Returns the function that should be used to parse the element identified - * by it's clark-notation name. + * by its clark-notation name. */ public function getDeserializerForElementName(string $name): callable { diff --git a/vendor/sabre/xml/lib/Service.php b/vendor/sabre/xml/lib/Service.php index 596c93cc4..a8e34d254 100644 --- a/vendor/sabre/xml/lib/Service.php +++ b/vendor/sabre/xml/lib/Service.php @@ -7,7 +7,7 @@ namespace Sabre\Xml; /** * XML parsing and writing service. * - * You are encouraged to make a instance of this for your application and + * You are encouraged to make an instance of this for your application and * potentially extend it, as a central API point for dealing with xml and * configuring the reader and writer. * @@ -117,7 +117,7 @@ class Service $input = (string) stream_get_contents($input); } - // If input is empty, then its safe to throw exception + // If input is empty, then it's safe to throw an exception if (empty($input)) { throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } @@ -161,7 +161,7 @@ class Service $input = (string) stream_get_contents($input); } - // If input is empty, then its safe to throw exception + // If input is empty, then it's safe to throw an exception if (empty($input)) { throw new ParseException('The input element to parse is empty. Do not attempt to parse'); } @@ -217,9 +217,9 @@ class Service } /** - * Map an xml element to a PHP class. + * Map an XML element to a PHP class. * - * Calling this function will automatically setup the Reader and Writer + * Calling this function will automatically set up the Reader and Writer * classes to turn a specific XML element to a PHP class. * * For example, given a class such as : diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index d4e465de9..1144bf085 100644 --- a/vendor/sabre/xml/lib/Version.php +++ b/vendor/sabre/xml/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - const VERSION = '2.2.3'; + const VERSION = '2.2.5'; } diff --git a/vendor/sabre/xml/lib/XmlSerializable.php b/vendor/sabre/xml/lib/XmlSerializable.php index b22f8d5e8..2affc33f1 100644 --- a/vendor/sabre/xml/lib/XmlSerializable.php +++ b/vendor/sabre/xml/lib/XmlSerializable.php @@ -20,7 +20,7 @@ interface XmlSerializable * Use the $writer argument to write its own xml serialization. * * An important note: do _not_ create a parent element. Any element - * implementing XmlSerializble should only ever write what's considered + * implementing XmlSerializable should only ever write what's considered * its 'inner xml'. * * The parent of the current element is responsible for writing a diff --git a/vendor/sabre/xml/phpstan.neon b/vendor/sabre/xml/phpstan.neon deleted file mode 100644 index d6dd4e577..000000000 --- a/vendor/sabre/xml/phpstan.neon +++ /dev/null @@ -1,6 +0,0 @@ -parameters: - level: 5 - ignoreErrors: - - - message: '!Parameter #3 \$uri of method XMLWriter::startElementNs\(\) expects string, null given.!' - path: lib/Writer.php |