diff options
Diffstat (limited to 'vendor/sabre')
91 files changed, 396 insertions, 583 deletions
diff --git a/vendor/sabre/dav/bin/googlecode_upload.py b/vendor/sabre/dav/bin/googlecode_upload.py deleted file mode 100755 index caafd5ded..000000000 --- a/vendor/sabre/dav/bin/googlecode_upload.py +++ /dev/null @@ -1,248 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2006, 2007 Google Inc. All Rights Reserved. -# Author: danderson@google.com (David Anderson) -# -# Script for uploading files to a Google Code project. -# -# This is intended to be both a useful script for people who want to -# streamline project uploads and a reference implementation for -# uploading files to Google Code projects. -# -# To upload a file to Google Code, you need to provide a path to the -# file on your local machine, a small summary of what the file is, a -# project name, and a valid account that is a member or owner of that -# project. You can optionally provide a list of labels that apply to -# the file. The file will be uploaded under the same name that it has -# in your local filesystem (that is, the "basename" or last path -# component). Run the script with '--help' to get the exact syntax -# and available options. -# -# Note that the upload script requests that you enter your -# googlecode.com password. This is NOT your Gmail account password! -# This is the password you use on googlecode.com for committing to -# Subversion and uploading files. You can find your password by going -# to http://code.google.com/hosting/settings when logged in with your -# Gmail account. If you have already committed to your project's -# Subversion repository, the script will automatically retrieve your -# credentials from there (unless disabled, see the output of '--help' -# for details). -# -# If you are looking at this script as a reference for implementing -# your own Google Code file uploader, then you should take a look at -# the upload() function, which is the meat of the uploader. You -# basically need to build a multipart/form-data POST request with the -# right fields and send it to https://PROJECT.googlecode.com/files . -# Authenticate the request using HTTP Basic authentication, as is -# shown below. -# -# Licensed under the terms of the Apache Software License 2.0: -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Questions, comments, feature requests and patches are most welcome. -# Please direct all of these to the Google Code users group: -# http://groups.google.com/group/google-code-hosting - -"""Google Code file uploader script. -""" - -__author__ = 'danderson@google.com (David Anderson)' - -import httplib -import os.path -import optparse -import getpass -import base64 -import sys - - -def upload(file, project_name, user_name, password, summary, labels=None): - """Upload a file to a Google Code project's file server. - - Args: - file: The local path to the file. - project_name: The name of your project on Google Code. - user_name: Your Google account name. - password: The googlecode.com password for your account. - Note that this is NOT your global Google Account password! - summary: A small description for the file. - labels: an optional list of label strings with which to tag the file. - - Returns: a tuple: - http_status: 201 if the upload succeeded, something else if an - error occurred. - http_reason: The human-readable string associated with http_status - file_url: If the upload succeeded, the URL of the file on Google - Code, None otherwise. - """ - # The login is the user part of user@gmail.com. If the login provided - # is in the full user@domain form, strip it down. - if user_name.endswith('@gmail.com'): - user_name = user_name[:user_name.index('@gmail.com')] - - form_fields = [('summary', summary)] - if labels is not None: - form_fields.extend([('label', l.strip()) for l in labels]) - - content_type, body = encode_upload_request(form_fields, file) - - upload_host = '%s.googlecode.com' % project_name - upload_uri = '/files' - auth_token = base64.b64encode('%s:%s'% (user_name, password)) - headers = { - 'Authorization': 'Basic %s' % auth_token, - 'User-Agent': 'Googlecode.com uploader v0.9.4', - 'Content-Type': content_type, - } - - server = httplib.HTTPSConnection(upload_host) - server.request('POST', upload_uri, body, headers) - resp = server.getresponse() - server.close() - - if resp.status == 201: - location = resp.getheader('Location', None) - else: - location = None - return resp.status, resp.reason, location - - -def encode_upload_request(fields, file_path): - """Encode the given fields and file into a multipart form body. - - fields is a sequence of (name, value) pairs. file is the path of - the file to upload. The file will be uploaded to Google Code with - the same file name. - - Returns: (content_type, body) ready for httplib.HTTP instance - """ - BOUNDARY = '----------Googlecode_boundary_reindeer_flotilla' - CRLF = '\r\n' - - body = [] - - # Add the metadata about the upload first - for key, value in fields: - body.extend( - ['--' + BOUNDARY, - 'Content-Disposition: form-data; name="%s"' % key, - '', - value, - ]) - - # Now add the file itself - file_name = os.path.basename(file_path) - f = open(file_path, 'rb') - file_content = f.read() - f.close() - - body.extend( - ['--' + BOUNDARY, - 'Content-Disposition: form-data; name="filename"; filename="%s"' - % file_name, - # The upload server determines the mime-type, no need to set it. - 'Content-Type: application/octet-stream', - '', - file_content, - ]) - - # Finalize the form body - body.extend(['--' + BOUNDARY + '--', '']) - - return 'multipart/form-data; boundary=%s' % BOUNDARY, CRLF.join(body) - - -def upload_find_auth(file_path, project_name, summary, labels=None, - user_name=None, password=None, tries=3): - """Find credentials and upload a file to a Google Code project's file server. - - file_path, project_name, summary, and labels are passed as-is to upload. - - Args: - file_path: The local path to the file. - project_name: The name of your project on Google Code. - summary: A small description for the file. - labels: an optional list of label strings with which to tag the file. - config_dir: Path to Subversion configuration directory, 'none', or None. - user_name: Your Google account name. - tries: How many attempts to make. - """ - - while tries > 0: - if user_name is None: - # Read username if not specified or loaded from svn config, or on - # subsequent tries. - sys.stdout.write('Please enter your googlecode.com username: ') - sys.stdout.flush() - user_name = sys.stdin.readline().rstrip() - if password is None: - # Read password if not loaded from svn config, or on subsequent tries. - print 'Please enter your googlecode.com password.' - print '** Note that this is NOT your Gmail account password! **' - print 'It is the password you use to access Subversion repositories,' - print 'and can be found here: http://code.google.com/hosting/settings' - password = getpass.getpass() - - status, reason, url = upload(file_path, project_name, user_name, password, - summary, labels) - # Returns 403 Forbidden instead of 401 Unauthorized for bad - # credentials as of 2007-07-17. - if status in [httplib.FORBIDDEN, httplib.UNAUTHORIZED]: - # Rest for another try. - user_name = password = None - tries = tries - 1 - else: - # We're done. - break - - return status, reason, url - - -def main(): - parser = optparse.OptionParser(usage='googlecode-upload.py -s SUMMARY ' - '-p PROJECT [options] FILE') - parser.add_option('-s', '--summary', dest='summary', - help='Short description of the file') - parser.add_option('-p', '--project', dest='project', - help='Google Code project name') - parser.add_option('-u', '--user', dest='user', - help='Your Google Code username') - parser.add_option('-w', '--password', dest='password', - help='Your Google Code password') - parser.add_option('-l', '--labels', dest='labels', - help='An optional list of comma-separated labels to attach ' - 'to the file') - - options, args = parser.parse_args() - - if not options.summary: - parser.error('File summary is missing.') - elif not options.project: - parser.error('Project name is missing.') - elif len(args) < 1: - parser.error('File to upload not provided.') - elif len(args) > 1: - parser.error('Only one file may be specified.') - - file_path = args[0] - - if options.labels: - labels = options.labels.split(',') - else: - labels = None - - status, reason, url = upload_find_auth(file_path, options.project, - options.summary, labels, - options.user, options.password) - if url: - print 'The file was uploaded successfully.' - print 'URL: %s' % url - return 0 - else: - print 'An error occurred. Your file was not uploaded.' - print 'Google Code upload server said: %s (%s)' % (reason, status) - return 1 - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/BackendInterface.php b/vendor/sabre/dav/lib/CalDAV/Backend/BackendInterface.php index 8bfa7446a..ccaa2519a 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/BackendInterface.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/BackendInterface.php @@ -221,7 +221,7 @@ interface BackendInterface * * This default may well be good enough for personal use, and calendars * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. + * or high loads, you are strongly advised to optimize certain paths. * * The best way to do so is override this method and to optimize * specifically for 'common filters'. diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/NotificationSupport.php b/vendor/sabre/dav/lib/CalDAV/Backend/NotificationSupport.php index 6e48d5454..5c04ae44c 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/NotificationSupport.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/NotificationSupport.php @@ -36,7 +36,7 @@ interface NotificationSupport extends BackendInterface public function getNotificationsForPrincipal($principalUri); /** - * This deletes a specific notifcation. + * This deletes a specific notification. * * This may be called by a client once it deems a notification handled. * diff --git a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php index b9f112cf8..634b9828c 100644 --- a/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CalDAV/Backend/PDO.php @@ -196,7 +196,7 @@ SQL //$stmt2 = $this->pdo->prepare('SELECT principaluri FROM ' . $this->calendarInstancesTableName . ' WHERE access = 1 AND id = ?'); //$stmt2->execute([$row['id']]); - // read-only is for backwards compatbility. Might go away in + // read-only is for backwards compatibility. Might go away in // the future. $calendar['read-only'] = \Sabre\DAV\Sharing\Plugin::ACCESS_READ === (int) $row['access']; } @@ -730,7 +730,7 @@ SQL * * This default may well be good enough for personal use, and calendars * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. + * or high loads, you are strongly advised to optimize certain paths. * * The best way to do so is override this method and to optimize * specifically for 'common filters'. diff --git a/vendor/sabre/dav/lib/CalDAV/Calendar.php b/vendor/sabre/dav/lib/CalDAV/Calendar.php index 6c0bf5411..ba8c704a5 100644 --- a/vendor/sabre/dav/lib/CalDAV/Calendar.php +++ b/vendor/sabre/dav/lib/CalDAV/Calendar.php @@ -435,7 +435,7 @@ class Calendar implements ICalendar, DAV\IProperties, DAV\Sync\ISyncCollection, * 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 + * TODO: RFC6578 Section 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 diff --git a/vendor/sabre/dav/lib/CalDAV/Notifications/Node.php b/vendor/sabre/dav/lib/CalDAV/Notifications/Node.php index 7d3a3f46b..5bf9a6018 100644 --- a/vendor/sabre/dav/lib/CalDAV/Notifications/Node.php +++ b/vendor/sabre/dav/lib/CalDAV/Notifications/Node.php @@ -70,7 +70,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL /** * Returns the etag for the notification. * - * The etag must be surrounded by litteral double-quotes. + * The etag must be surrounded by literal double-quotes. * * @return string */ @@ -101,7 +101,7 @@ class Node extends DAV\File implements INode, DAVACL\IACL /** * Returns the owner principal. * - * This must be a url to a principal, or null if there's no owner + * This must be an url to a principal, or null if there's no owner * * @return string|null */ diff --git a/vendor/sabre/dav/lib/CalDAV/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Plugin.php index 98f4f554c..ccb722f85 100644 --- a/vendor/sabre/dav/lib/CalDAV/Plugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Plugin.php @@ -720,7 +720,7 @@ class Plugin extends DAV\ServerPlugin return; } - // We're onyl interested in ICalendarObject nodes that are inside of a + // We're only interested in ICalendarObject nodes that are inside of a // real calendar. This is to avoid triggering validation and scheduling // for non-calendars (such as an inbox). list($parent) = Uri\split($path); @@ -913,7 +913,7 @@ class Plugin extends DAV\ServerPlugin } /** - * This method is triggered whenever a subsystem reqeuests the privileges + * This method is triggered whenever a subsystem requests the privileges * that are supported on a particular node. */ public function getSupportedPrivilegeSet(INode $node, array &$supportedPrivilegeSet) diff --git a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php index 5e5659610..5bca56d47 100644 --- a/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php +++ b/vendor/sabre/dav/lib/CalDAV/Schedule/Plugin.php @@ -25,6 +25,7 @@ use Sabre\HTTP\ResponseInterface; use Sabre\VObject; use Sabre\VObject\Component\VCalendar; use Sabre\VObject\ITip; +use Sabre\VObject\ITip\Broker; use Sabre\VObject\ITip\Message; use Sabre\VObject\Reader; @@ -389,7 +390,7 @@ class Plugin extends ServerPlugin $node->getOwner() ); - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $messages = $broker->parseEvent(null, $addresses, $node->get()); foreach ($messages as $message) { @@ -500,7 +501,7 @@ class Plugin extends ServerPlugin $isNewNode = true; } - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $newObject = $broker->processMessage($iTipMessage, $currentObject); $inbox->createFile($newFileName, $iTipMessage->message->serialize()); @@ -611,7 +612,7 @@ class Plugin extends ServerPlugin */ protected function processICalendarChange($oldObject, VCalendar $newObject, array $addresses, array $ignore = [], &$modified = false) { - $broker = new ITip\Broker(); + $broker = $this->createITipBroker(); $messages = $broker->parseEvent($newObject, $addresses, $oldObject); if ($messages) { @@ -994,4 +995,12 @@ class Plugin extends ServerPlugin 'link' => 'http://sabre.io/dav/scheduling/', ]; } + + /** + * Returns an instance of the iTip\Broker. + */ + protected function createITipBroker(): Broker + { + return new Broker(); + } } diff --git a/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php b/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php index f7dca9be6..bacfe0441 100644 --- a/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php +++ b/vendor/sabre/dav/lib/CalDAV/SharingPlugin.php @@ -136,7 +136,7 @@ class SharingPlugin extends DAV\ServerPlugin } /** - * This method is trigged when a user attempts to update a node's + * This method is triggered when a user attempts to update a node's * properties. * * A previous draft of the sharing spec stated that it was possible to use diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php index 3b3a94b26..4771a2070 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarMultiGetReport.php @@ -48,7 +48,7 @@ class CalendarMultiGetReport implements XmlDeserializable public $expand = null; /** - * The mimetype of the content that should be returend. Usually + * The mimetype of the content that should be returned. Usually * text/calendar. * * @var string diff --git a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php index b3cc299d3..5a4df4674 100644 --- a/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php +++ b/vendor/sabre/dav/lib/CalDAV/Xml/Request/CalendarQueryReport.php @@ -48,7 +48,7 @@ class CalendarQueryReport implements XmlDeserializable public $expand = null; /** - * The mimetype of the content that should be returend. Usually + * The mimetype of the content that should be returned. Usually * text/calendar. * * @var string diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php b/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php index 6ef34d173..f9955ac83 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/BackendInterface.php @@ -88,7 +88,7 @@ interface BackendInterface * * size - The size of the card in bytes. * * If these last two properties are provided, less time will be spent - * calculating them. If they are specified, you can also ommit carddata. + * calculating them. If they are specified, you can also omit carddata. * This may speed up certain requests, especially with large cards. * * @param mixed $addressbookId @@ -98,7 +98,7 @@ interface BackendInterface public function getCards($addressbookId); /** - * Returns a specfic card. + * Returns a specific card. * * The same set of properties must be returned as with getCards. The only * exception is that 'carddata' is absolutely required. diff --git a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php index 4ca9284a9..7b935a4ae 100644 --- a/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php +++ b/vendor/sabre/dav/lib/CardDAV/Backend/PDO.php @@ -205,7 +205,7 @@ class PDO extends AbstractBackend implements SyncSupport * * size - The size of the card in bytes. * * If these last two properties are provided, less time will be spent - * calculating them. If they are specified, you can also ommit carddata. + * calculating them. If they are specified, you can also omit carddata. * This may speed up certain requests, especially with large cards. * * @param mixed $addressbookId diff --git a/vendor/sabre/dav/lib/CardDAV/Plugin.php b/vendor/sabre/dav/lib/CardDAV/Plugin.php index c2d31d9df..810ae3a1a 100644 --- a/vendor/sabre/dav/lib/CardDAV/Plugin.php +++ b/vendor/sabre/dav/lib/CardDAV/Plugin.php @@ -800,7 +800,7 @@ class Plugin extends DAV\ServerPlugin * * @return string */ - protected function convertVCard($data, $target, array $propertiesFilter = null) + protected function convertVCard($data, $target, ?array $propertiesFilter = null) { if (is_resource($data)) { $data = stream_get_contents($data); diff --git a/vendor/sabre/dav/lib/CardDAV/Xml/Property/SupportedAddressData.php b/vendor/sabre/dav/lib/CardDAV/Xml/Property/SupportedAddressData.php index fe5f976a0..536c5a19f 100644 --- a/vendor/sabre/dav/lib/CardDAV/Xml/Property/SupportedAddressData.php +++ b/vendor/sabre/dav/lib/CardDAV/Xml/Property/SupportedAddressData.php @@ -34,7 +34,7 @@ class SupportedAddressData implements XmlSerializable /** * Creates the property. */ - public function __construct(array $supportedData = null) + public function __construct(?array $supportedData = null) { if (is_null($supportedData)) { $supportedData = [ diff --git a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php index e1096fe28..02402f6c7 100644 --- a/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php +++ b/vendor/sabre/dav/lib/CardDAV/Xml/Request/AddressBookQueryReport.php @@ -82,7 +82,7 @@ class AddressBookQueryReport implements XmlDeserializable public $test; /** - * The mimetype of the content that should be returend. Usually + * The mimetype of the content that should be returned. Usually * text/vcard. * * @var string diff --git a/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php b/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php index 39324e4db..d142cbfbf 100644 --- a/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php +++ b/vendor/sabre/dav/lib/DAV/Auth/Backend/PDOBasicAuth.php @@ -44,7 +44,7 @@ class PDOBasicAuth extends AbstractBasic * 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. + * cut it off before verifying. * * @var string */ diff --git a/vendor/sabre/dav/lib/DAV/Auth/Plugin.php b/vendor/sabre/dav/lib/DAV/Auth/Plugin.php index eb4f27ca6..47fbe205a 100644 --- a/vendor/sabre/dav/lib/DAV/Auth/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Auth/Plugin.php @@ -58,7 +58,7 @@ class Plugin extends ServerPlugin * * @param Backend\BackendInterface $authBackend */ - public function __construct(Backend\BackendInterface $authBackend = null) + public function __construct(?Backend\BackendInterface $authBackend = null) { if (!is_null($authBackend)) { $this->addBackend($authBackend); diff --git a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php index 89495e5db..a8a6f430e 100644 --- a/vendor/sabre/dav/lib/DAV/Browser/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Browser/Plugin.php @@ -522,7 +522,7 @@ HTML; /** * This method takes a path/name of an asset and turns it into url - * suiteable for http access. + * suitable for http access. * * @param string $assetName * diff --git a/vendor/sabre/dav/lib/DAV/Exception/InvalidSyncToken.php b/vendor/sabre/dav/lib/DAV/Exception/InvalidSyncToken.php index 37b28ca54..f28d20f41 100644 --- a/vendor/sabre/dav/lib/DAV/Exception/InvalidSyncToken.php +++ b/vendor/sabre/dav/lib/DAV/Exception/InvalidSyncToken.php @@ -9,7 +9,7 @@ use Sabre\DAV; /** * InvalidSyncToken. * - * This exception is emited for the {DAV:}valid-sync-token pre-condition, as + * This exception is emitted for the {DAV:}valid-sync-token pre-condition, as * defined in rfc6578, section 3.2. * * http://tools.ietf.org/html/rfc6578#section-3.2 diff --git a/vendor/sabre/dav/lib/DAV/Exception/Locked.php b/vendor/sabre/dav/lib/DAV/Exception/Locked.php index 28263cf13..24fad7095 100644 --- a/vendor/sabre/dav/lib/DAV/Exception/Locked.php +++ b/vendor/sabre/dav/lib/DAV/Exception/Locked.php @@ -32,7 +32,7 @@ class Locked extends DAV\Exception * * @param DAV\Locks\LockInfo $lock */ - public function __construct(DAV\Locks\LockInfo $lock = null) + public function __construct(?DAV\Locks\LockInfo $lock = null) { parent::__construct(); diff --git a/vendor/sabre/dav/lib/DAV/Exception/TooManyMatches.php b/vendor/sabre/dav/lib/DAV/Exception/TooManyMatches.php index 3f7d2d5fb..ef6f50243 100644 --- a/vendor/sabre/dav/lib/DAV/Exception/TooManyMatches.php +++ b/vendor/sabre/dav/lib/DAV/Exception/TooManyMatches.php @@ -9,7 +9,7 @@ use Sabre\DAV; /** * TooManyMatches. * - * This exception is emited for the {DAV:}number-of-matches-within-limits + * This exception is emitted for the {DAV:}number-of-matches-within-limits * post-condition, as defined in rfc6578, section 3.2. * * http://tools.ietf.org/html/rfc6578#section-3.2 diff --git a/vendor/sabre/dav/lib/DAV/INodeByPath.php b/vendor/sabre/dav/lib/DAV/INodeByPath.php index 4d63a33bd..349ea1053 100644 --- a/vendor/sabre/dav/lib/DAV/INodeByPath.php +++ b/vendor/sabre/dav/lib/DAV/INodeByPath.php @@ -9,7 +9,7 @@ namespace Sabre\DAV; * * This interface adds a tiny bit of functionality to collections. * - * Getting a node that is deep in the tree normally requires going trough each parent node + * Getting a node that is deep in the tree normally requires going through each parent node * which can cause a significant performance overhead. * * Implementing this interface allows solving this overhead by directly jumping to the target node. diff --git a/vendor/sabre/dav/lib/DAV/Server.php b/vendor/sabre/dav/lib/DAV/Server.php index 1f8300d4a..3133e54ad 100644 --- a/vendor/sabre/dav/lib/DAV/Server.php +++ b/vendor/sabre/dav/lib/DAV/Server.php @@ -211,7 +211,7 @@ class Server implements LoggerAwareInterface, EmitterInterface * * @throws Exception */ - public function __construct($treeOrNode = null, HTTP\Sapi $sapi = null) + public function __construct($treeOrNode = null, ?HTTP\Sapi $sapi = null) { if ($treeOrNode instanceof Tree) { $this->tree = $treeOrNode; @@ -882,7 +882,7 @@ class Server implements LoggerAwareInterface, EmitterInterface * * @return \Traversable */ - private function generatePathNodes(PropFind $propFind, array $yieldFirst = null) + private function generatePathNodes(PropFind $propFind, ?array $yieldFirst = null) { if (null !== $yieldFirst) { yield $yieldFirst; @@ -1635,6 +1635,8 @@ class Server implements LoggerAwareInterface, EmitterInterface */ public function generateMultiStatus($fileProperties, $strip404s = false) { + $this->emit('beforeMultiStatus', [&$fileProperties]); + $w = $this->xml->getWriter(); if (self::$streamMultiStatus) { return function () use ($fileProperties, $strip404s, $w) { diff --git a/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php b/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php index e7adbeee6..d766ae0de 100644 --- a/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php +++ b/vendor/sabre/dav/lib/DAV/Sharing/Plugin.php @@ -194,7 +194,7 @@ class Plugin extends ServerPlugin } /** - * This method is triggered whenever a subsystem reqeuests the privileges + * This method is triggered whenever a subsystem requests the privileges * hat are supported on a particular node. * * We need to add a number of privileges for scheduling purposes. diff --git a/vendor/sabre/dav/lib/DAV/Tree.php b/vendor/sabre/dav/lib/DAV/Tree.php index 65b4583ce..1483e1bc5 100644 --- a/vendor/sabre/dav/lib/DAV/Tree.php +++ b/vendor/sabre/dav/lib/DAV/Tree.php @@ -62,9 +62,21 @@ class Tree implements INodeByPath return $this->rootNode; } - $parts = explode('/', $path); $node = $this->rootNode; + // look for any cached parent and collect the parts below the parent + $parts = []; + $remainingPath = $path; + do { + list($remainingPath, $baseName) = Uri\split($remainingPath); + array_unshift($parts, $baseName); + + if (isset($this->cache[$remainingPath])) { + $node = $this->cache[$remainingPath]; + break; + } + } while ('' !== $remainingPath); + while (count($parts)) { if (!($node instanceof ICollection)) { throw new Exception\NotFound('Could not find node at path: '.$path); diff --git a/vendor/sabre/dav/lib/DAV/Version.php b/vendor/sabre/dav/lib/DAV/Version.php index 345c62d7e..e6aee097c 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.6.0'; + public const VERSION = '4.7.0'; } diff --git a/vendor/sabre/dav/lib/DAVACL/Plugin.php b/vendor/sabre/dav/lib/DAVACL/Plugin.php index 46d680e15..f0497844d 100644 --- a/vendor/sabre/dav/lib/DAVACL/Plugin.php +++ b/vendor/sabre/dav/lib/DAVACL/Plugin.php @@ -716,7 +716,7 @@ class Plugin extends DAV\ServerPlugin * @param array $requestedProperties this is the list of properties to * return for every match * @param string $collectionUri the principal collection to search on. - * If this is ommitted, the standard + * If this is omitted, the standard * principal collection-set will be used * @param string $test "allof" to use AND to search the * properties. 'anyof' for OR. diff --git a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php index 17bc245c5..178bd7276 100644 --- a/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php +++ b/vendor/sabre/dav/lib/DAVACL/PrincipalBackend/PDO.php @@ -80,7 +80,7 @@ class PDO extends AbstractBackend implements CreatePrincipalSupport * return any additional properties if you wish so. Common properties are: * {DAV:}displayname * {http://sabredav.org/ns}email-address - This is a custom SabreDAV - * field that's actualy injected in a number of other properties. If + * field that's actually injected in a number of other properties. If * you have an email address, use this property. * * @param string $prefixPath diff --git a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php index 52092128f..5b9ee4517 100644 --- a/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php +++ b/vendor/sabre/dav/lib/DAVACL/Xml/Property/Principal.php @@ -149,7 +149,7 @@ class Principal extends DAV\Xml\Property\Href /** * 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/event/.github/workflows/ci.yml b/vendor/sabre/event/.github/workflows/ci.yml deleted file mode 100644 index 3473cd2de..000000000 --- a/vendor/sabre/event/.github/workflows/ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -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/.php-cs-fixer.dist.php b/vendor/sabre/event/.php-cs-fixer.dist.php new file mode 100644 index 000000000..319886c6b --- /dev/null +++ b/vendor/sabre/event/.php-cs-fixer.dist.php @@ -0,0 +1,18 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->exclude('vendor') + ->in(__DIR__); + +$config = new PhpCsFixer\Config(); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true, + 'blank_line_between_import_groups' => false, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, +]); +$config->setFinder($finder); +return $config;
\ No newline at end of file diff --git a/vendor/sabre/event/.php_cs.dist b/vendor/sabre/event/.php_cs.dist deleted file mode 100644 index c5c78a971..000000000 --- a/vendor/sabre/event/.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/event/bin/.empty b/vendor/sabre/event/bin/.empty deleted file mode 100644 index e69de29bb..000000000 --- a/vendor/sabre/event/bin/.empty +++ /dev/null diff --git a/vendor/sabre/event/composer.json b/vendor/sabre/event/composer.json index 42fb4aa22..0d3ec0621 100644 --- a/vendor/sabre/event/composer.json +++ b/vendor/sabre/event/composer.json @@ -46,16 +46,16 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6" }, "scripts": { "phpstan": [ "phpstan analyse lib tests" ], "cs-fixer": [ - "php-cs-fixer fix" + "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix" ], "phpunit": [ "phpunit --configuration tests/phpunit.xml" diff --git a/vendor/sabre/event/lib/EmitterInterface.php b/vendor/sabre/event/lib/EmitterInterface.php index 6ce0f34db..662efd739 100644 --- a/vendor/sabre/event/lib/EmitterInterface.php +++ b/vendor/sabre/event/lib/EmitterInterface.php @@ -47,7 +47,7 @@ interface EmitterInterface * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool; + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool; /** * Returns the list of listeners for an event. @@ -74,5 +74,5 @@ interface EmitterInterface * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null); + public function removeAllListeners(?string $eventName = null); } diff --git a/vendor/sabre/event/lib/EmitterTrait.php b/vendor/sabre/event/lib/EmitterTrait.php index 5502ef9f3..5a0a23457 100644 --- a/vendor/sabre/event/lib/EmitterTrait.php +++ b/vendor/sabre/event/lib/EmitterTrait.php @@ -73,7 +73,7 @@ trait EmitterTrait * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool { if (\is_null($continueCallBack)) { foreach ($this->listeners($eventName) as $listener) { @@ -160,7 +160,7 @@ trait EmitterTrait * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null) + public function removeAllListeners(?string $eventName = null) { if (!\is_null($eventName)) { unset($this->listeners[$eventName]); diff --git a/vendor/sabre/event/lib/Loop/Loop.php b/vendor/sabre/event/lib/Loop/Loop.php index b85a7a440..74981da08 100644 --- a/vendor/sabre/event/lib/Loop/Loop.php +++ b/vendor/sabre/event/lib/Loop/Loop.php @@ -24,7 +24,7 @@ class Loop */ public function setTimeout(callable $cb, float $timeout) { - $triggerTime = microtime(true) + ($timeout); + $triggerTime = microtime(true) + $timeout; if (!$this->timers) { // Special case when the timers array was empty. @@ -265,7 +265,7 @@ class Loop * If $timeout is 0, it will return immediately. If $timeout is null, it * will wait indefinitely. * - * @param float|null timeout + * @param float|null $timeout */ protected function runStreams($timeout) { diff --git a/vendor/sabre/event/lib/Loop/functions.php b/vendor/sabre/event/lib/Loop/functions.php index bf4d933f2..9412a77ff 100644 --- a/vendor/sabre/event/lib/Loop/functions.php +++ b/vendor/sabre/event/lib/Loop/functions.php @@ -130,7 +130,7 @@ function stop() /** * Retrieves or sets the global Loop object. */ -function instance(Loop $newLoop = null): Loop +function instance(?Loop $newLoop = null): Loop { static $loop; if ($newLoop) { diff --git a/vendor/sabre/event/lib/Promise.php b/vendor/sabre/event/lib/Promise.php index 42969a55f..66903fb9f 100644 --- a/vendor/sabre/event/lib/Promise.php +++ b/vendor/sabre/event/lib/Promise.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event; use Exception; -use Throwable; /** * An implementation of the Promise pattern. @@ -30,17 +29,17 @@ class Promise /** * The asynchronous operation is pending. */ - const PENDING = 0; + public const PENDING = 0; /** * The asynchronous operation has completed, and has a result. */ - const FULFILLED = 1; + public const FULFILLED = 1; /** * The asynchronous operation has completed with an error. */ - const REJECTED = 2; + public const REJECTED = 2; /** * The current state of this promise. @@ -58,7 +57,7 @@ class Promise * Each are callbacks that map to $this->fulfill and $this->reject. * Using the executor is optional. */ - public function __construct(callable $executor = null) + public function __construct(?callable $executor = null) { if ($executor) { $executor( @@ -87,7 +86,7 @@ class Promise * If either of the callbacks throw an exception, the returned promise will * be rejected and the exception will be passed back. */ - public function then(callable $onFulfilled = null, callable $onRejected = null): Promise + public function then(?callable $onFulfilled = null, ?callable $onRejected = null): Promise { // This new subPromise will be returned from this function, and will // be fulfilled with the result of the onFulfilled or onRejected event @@ -128,8 +127,6 @@ class Promise /** * Marks this promise as fulfilled and sets its return value. - * - * @param mixed $value */ public function fulfill($value = null) { @@ -146,7 +143,7 @@ class Promise /** * Marks this promise as rejected, and set its rejection reason. */ - public function reject(Throwable $reason) + public function reject(\Throwable $reason) { if (self::PENDING !== $this->state) { throw new PromiseAlreadyResolvedException('This promise is already resolved, and you\'re not allowed to resolve a promise more than once'); @@ -169,7 +166,6 @@ class Promise * one. In PHP it might be useful to call this on the last promise in a * chain. * - * @return mixed * @psalm-return TReturn */ public function wait() @@ -208,10 +204,8 @@ class Promise * * If the promise was fulfilled, this will be the result value. If the * promise was rejected, this property hold the rejection reason. - * - * @var mixed */ - protected $value = null; + protected $value; /** * This method is used to call either an onFulfilled or onRejected callback. @@ -219,10 +213,8 @@ class Promise * This method makes sure that the result of these callbacks are handled * correctly, and any chained promises are also correctly fulfilled or * rejected. - * - * @param callable $callBack */ - private function invokeCallback(Promise $subPromise, callable $callBack = null) + private function invokeCallback(Promise $subPromise, ?callable $callBack = null) { // We use 'nextTick' to ensure that the event handlers are always // triggered outside of the calling stack in which they were originally @@ -244,7 +236,7 @@ class Promise // immediately fulfill the chained promise. $subPromise->fulfill($result); } - } catch (Throwable $e) { + } catch (\Throwable $e) { // If the event handler threw an exception, we need to make sure that // the chained promise is rejected as well. $subPromise->reject($e); diff --git a/vendor/sabre/event/lib/Promise/functions.php b/vendor/sabre/event/lib/Promise/functions.php index fbed63471..67e80cbe4 100644 --- a/vendor/sabre/event/lib/Promise/functions.php +++ b/vendor/sabre/event/lib/Promise/functions.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event\Promise; use Sabre\Event\Promise; -use Throwable; /** * This file contains a set of functions that are useful for dealing with the @@ -101,8 +100,6 @@ function race(array $promises): Promise * * If the value is a promise, the returned promise will attach itself to that * promise and eventually get the same state as the followed promise. - * - * @param mixed $value */ function resolve($value): Promise { @@ -119,7 +116,7 @@ function resolve($value): Promise /** * Returns a Promise that will reject with the given reason. */ -function reject(Throwable $reason): Promise +function reject(\Throwable $reason): Promise { $promise = new Promise(); $promise->reject($reason); diff --git a/vendor/sabre/event/lib/Version.php b/vendor/sabre/event/lib/Version.php index fe8f5c3bf..10a98c607 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.4'; + public const VERSION = '5.1.7'; } diff --git a/vendor/sabre/event/lib/WildcardEmitterTrait.php b/vendor/sabre/event/lib/WildcardEmitterTrait.php index 206a8f3c5..69243ff83 100644 --- a/vendor/sabre/event/lib/WildcardEmitterTrait.php +++ b/vendor/sabre/event/lib/WildcardEmitterTrait.php @@ -82,7 +82,7 @@ trait WildcardEmitterTrait * Lastly, if there are 5 event handlers for an event. The continueCallback * will be called at most 4 times. */ - public function emit(string $eventName, array $arguments = [], callable $continueCallBack = null): bool + public function emit(string $eventName, array $arguments = [], ?callable $continueCallBack = null): bool { if (\is_null($continueCallBack)) { foreach ($this->listeners($eventName) as $listener) { @@ -195,7 +195,7 @@ trait WildcardEmitterTrait * removed. If it is not specified, every listener for every event is * removed. */ - public function removeAllListeners(string $eventName = null) + public function removeAllListeners(?string $eventName = null) { if (\is_null($eventName)) { $this->listeners = []; diff --git a/vendor/sabre/event/lib/coroutine.php b/vendor/sabre/event/lib/coroutine.php index cdf2d3ecd..f664efa78 100644 --- a/vendor/sabre/event/lib/coroutine.php +++ b/vendor/sabre/event/lib/coroutine.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Event; use Generator; -use Throwable; /** * Turn asynchronous promise-based code into something that looks synchronous @@ -42,10 +41,10 @@ use Throwable; * * }); * - * @return \Sabre\Event\Promise - * * @psalm-template TReturn + * * @psalm-param callable():\Generator<mixed, mixed, mixed, TReturn> $gen + * * @psalm-return Promise<TReturn> * * @copyright Copyright (C) fruux GmbH (https://fruux.com/) @@ -55,7 +54,7 @@ use Throwable; function coroutine(callable $gen): Promise { $generator = $gen(); - if (!$generator instanceof Generator) { + if (!$generator instanceof \Generator) { throw new \InvalidArgumentException('You must pass a generator function'); } @@ -75,11 +74,11 @@ function coroutine(callable $gen): Promise $generator->send($value); $advanceGenerator(); }, - function (Throwable $reason) use ($generator, $advanceGenerator) { + function (\Throwable $reason) use ($generator, $advanceGenerator) { $generator->throw($reason); $advanceGenerator(); } - )->otherwise(function (Throwable $reason) use ($promise) { + )->otherwise(function (\Throwable $reason) use ($promise) { // This error handler would be called, if something in the // generator throws an exception, and it's not caught // locally. @@ -104,7 +103,7 @@ function coroutine(callable $gen): Promise if ($returnValue instanceof Promise) { $returnValue->then(function ($value) use ($promise) { $promise->fulfill($value); - }, function (Throwable $reason) use ($promise) { + }, function (\Throwable $reason) use ($promise) { $promise->reject($reason); }); } else { @@ -115,7 +114,7 @@ function coroutine(callable $gen): Promise try { $advanceGenerator(); - } catch (Throwable $e) { + } catch (\Throwable $e) { $promise->reject($e); } diff --git a/vendor/sabre/event/phpstan.neon b/vendor/sabre/event/phpstan.neon deleted file mode 100644 index 213da6dad..000000000 --- a/vendor/sabre/event/phpstan.neon +++ /dev/null @@ -1,2 +0,0 @@ -parameters: - level: 1 diff --git a/vendor/sabre/http/.github/workflows/ci.yml b/vendor/sabre/http/.github/workflows/ci.yml index cbb681e53..56bc1a321 100644 --- a/vendor/sabre/http/.github/workflows/ci.yml +++ b/vendor/sabre/http/.github/workflows/ci.yml @@ -12,15 +12,20 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] coverage: ['xdebug'] + code-style: ['yes'] code-analysis: ['no'] include: - php-versions: '7.1' + code-style: 'yes' + code-analysis: 'yes' + - php-versions: '8.4' + code-style: 'yes' code-analysis: 'yes' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php @@ -35,7 +40,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} @@ -45,8 +50,8 @@ jobs: 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 + if: matrix.code-style == 'yes' + run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff - name: Code Analysis (PHPStan) if: matrix.code-analysis == 'yes' @@ -59,5 +64,5 @@ jobs: run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml - name: Code Coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 if: matrix.coverage != 'none' diff --git a/vendor/sabre/http/.gitignore b/vendor/sabre/http/.gitignore index 367bba576..a5356dd00 100644 --- a/vendor/sabre/http/.gitignore +++ b/vendor/sabre/http/.gitignore @@ -6,3 +6,4 @@ composer.lock tests/cov/ .phpunit.result.cache .php_cs.cache +.php-cs-fixer.cache diff --git a/vendor/sabre/http/.php-cs-fixer.dist.php b/vendor/sabre/http/.php-cs-fixer.dist.php new file mode 100644 index 000000000..f9d4b7a8d --- /dev/null +++ b/vendor/sabre/http/.php-cs-fixer.dist.php @@ -0,0 +1,17 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->exclude('vendor') + ->in(__DIR__); + +$config = new PhpCsFixer\Config(); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, +]); +$config->setFinder($finder); +return $config;
\ No newline at end of file diff --git a/vendor/sabre/http/CHANGELOG.md b/vendor/sabre/http/CHANGELOG.md index 2dddce4fb..4158150f4 100644 --- a/vendor/sabre/http/CHANGELOG.md +++ b/vendor/sabre/http/CHANGELOG.md @@ -1,6 +1,37 @@ ChangeLog ========= +5.1.12 (2024-08-27) +------------------ + +* #243 add cs-fixer v3 (@phil-davis) + +5.1.11 (2024-07-26) +------------------ + +* #241 PHP 8.4 compliance (@phil-davis) + +5.1.10 (2023-08-18) +------------------ + +* #225 Enhance tests/bootstrap.php to find autoloader in more environments (@phil-davis) + +5.1.9 (2023-08-17) +------------------ + +* #223 skip testParseMimeTypeOnInvalidMimeType (@phil-davis) + +5.1.8 (2023-08-17) +------------------ + +* #215 Improve CURLOPT_HTTPHEADER Setting Assignment (@amrita-shrestha) + +5.1.7 (2023-06-26) +------------------ + +* #98 and #176 Add more tests (@peter279k) +* #207 fix: handle client disconnect properly with ignore_user_abort true (@kesselb) + 5.1.6 (2022-07-15) ------------------ diff --git a/vendor/sabre/http/composer.json b/vendor/sabre/http/composer.json index 353646a28..48caa44f8 100644 --- a/vendor/sabre/http/composer.json +++ b/vendor/sabre/http/composer.json @@ -13,9 +13,9 @@ "sabre/uri" : "^2.0" }, "require-dev" : { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||^3.63", "phpstan/phpstan": "^0.12", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6" }, "suggest" : { "ext-curl" : " to make http requests with the Client class" @@ -50,7 +50,7 @@ "phpstan analyse lib tests" ], "cs-fixer": [ - "php-cs-fixer fix" + "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix" ], "phpunit": [ "phpunit --configuration tests/phpunit.xml" diff --git a/vendor/sabre/http/lib/Auth/AWS.php b/vendor/sabre/http/lib/Auth/AWS.php index ffda3cf15..2690c634d 100644 --- a/vendor/sabre/http/lib/Auth/AWS.php +++ b/vendor/sabre/http/lib/Auth/AWS.php @@ -22,14 +22,14 @@ class AWS extends AbstractAuth * * @var string */ - private $signature = null; + private $signature; /** * The accesskey supplied by the HTTP client. * * @var string */ - private $accessKey = null; + private $accessKey; /** * An error code, if any. @@ -40,11 +40,11 @@ class AWS extends AbstractAuth */ public $errorCode = 0; - const ERR_NOAWSHEADER = 1; - const ERR_MD5CHECKSUMWRONG = 2; - const ERR_INVALIDDATEFORMAT = 3; - const ERR_REQUESTTIMESKEWED = 4; - const ERR_INVALIDSIGNATURE = 5; + public const ERR_NOAWSHEADER = 1; + public const ERR_MD5CHECKSUMWRONG = 2; + public const ERR_INVALIDDATEFORMAT = 3; + public const ERR_REQUESTTIMESKEWED = 4; + public const ERR_INVALIDSIGNATURE = 5; /** * Gathers all information from the headers. @@ -212,7 +212,7 @@ class AWS extends AbstractAuth } $key = str_pad($key, $blocksize, chr(0x00)); $ipad = str_repeat(chr(0x36), $blocksize); - $opad = str_repeat(chr(0x5c), $blocksize); + $opad = str_repeat(chr(0x5C), $blocksize); $hmac = pack('H*', sha1(($key ^ $opad).pack('H*', sha1(($key ^ $ipad).$message)))); return $hmac; diff --git a/vendor/sabre/http/lib/Auth/Digest.php b/vendor/sabre/http/lib/Auth/Digest.php index e80e78305..08fa34f90 100644 --- a/vendor/sabre/http/lib/Auth/Digest.php +++ b/vendor/sabre/http/lib/Auth/Digest.php @@ -34,8 +34,8 @@ class Digest extends AbstractAuth /** * These constants are used in setQOP();. */ - const QOP_AUTH = 1; - const QOP_AUTHINT = 2; + public const QOP_AUTH = 1; + public const QOP_AUTHINT = 2; protected $nonce; protected $opaque; @@ -177,8 +177,6 @@ class Digest extends AbstractAuth * It should be compatible with mod_php format and other webservers. * * If the header could not be found, null will be returned - * - * @return mixed */ public function getDigest() { diff --git a/vendor/sabre/http/lib/Client.php b/vendor/sabre/http/lib/Client.php index 2bc7483a7..c00f9e1b1 100644 --- a/vendor/sabre/http/lib/Client.php +++ b/vendor/sabre/http/lib/Client.php @@ -175,7 +175,7 @@ class Client extends EventEmitter * After calling sendAsync, you must therefore occasionally call the poll() * method, or wait(). */ - public function sendAsync(RequestInterface $request, callable $success = null, callable $error = null) + public function sendAsync(RequestInterface $request, ?callable $success = null, ?callable $error = null) { $this->emit('beforeRequest', [$request]); $this->sendAsyncInternal($request, $success, $error); @@ -299,8 +299,6 @@ class Client extends EventEmitter * Adds a CURL setting. * * These settings will be included in every HTTP request. - * - * @param mixed $value */ public function addCurlSetting(int $name, $value) { @@ -402,7 +400,10 @@ class Client extends EventEmitter $nHeaders[] = $key.': '.$value; } } - $settings[CURLOPT_HTTPHEADER] = $nHeaders; + + if ([] !== $nHeaders) { + $settings[CURLOPT_HTTPHEADER] = $nHeaders; + } $settings[CURLOPT_URL] = $request->getUrl(); // FIXME: CURLOPT_PROTOCOLS is currently unsupported by HHVM if (defined('CURLOPT_PROTOCOLS')) { @@ -416,9 +417,9 @@ class Client extends EventEmitter return $settings; } - const STATUS_SUCCESS = 0; - const STATUS_CURLERROR = 1; - const STATUS_HTTPERROR = 2; + public const STATUS_SUCCESS = 0; + public const STATUS_CURLERROR = 1; + public const STATUS_HTTPERROR = 2; private function parseResponse(string $response, $curlHandle): array { diff --git a/vendor/sabre/http/lib/Request.php b/vendor/sabre/http/lib/Request.php index b8395ff45..99a13d25a 100644 --- a/vendor/sabre/http/lib/Request.php +++ b/vendor/sabre/http/lib/Request.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Sabre\HTTP; -use LogicException; use Sabre\Uri; /** diff --git a/vendor/sabre/http/lib/Response.php b/vendor/sabre/http/lib/Response.php index c06c9637e..78ebb220d 100644 --- a/vendor/sabre/http/lib/Response.php +++ b/vendor/sabre/http/lib/Response.php @@ -100,10 +100,9 @@ class Response extends Message implements ResponseInterface * Creates the response object. * * @param string|int $status - * @param array $headers * @param resource $body */ - public function __construct($status = 500, array $headers = null, $body = null) + public function __construct($status = 500, ?array $headers = null, $body = null) { if (null !== $status) { $this->setStatus($status); diff --git a/vendor/sabre/http/lib/Sapi.php b/vendor/sabre/http/lib/Sapi.php index f8e8397fc..4c8fb6732 100644 --- a/vendor/sabre/http/lib/Sapi.php +++ b/vendor/sabre/http/lib/Sapi.php @@ -4,8 +4,6 @@ declare(strict_types=1); namespace Sabre\HTTP; -use InvalidArgumentException; - /** * PHP SAPI. * @@ -115,6 +113,12 @@ class Sapi if ($copied <= 0) { break; } + // Abort on client disconnect. + // With ignore_user_abort(true), the script is not aborted on client disconnect. + // To avoid reading the entire stream and dismissing the data afterward, check between the chunks if the client is still there. + if (1 === ignore_user_abort() && 1 === connection_aborted()) { + break; + } $left -= $copied; } } else { @@ -162,7 +166,7 @@ class Sapi $url = $value; break; - // These sometimes show up without a HTTP_ prefix + // These sometimes show up without a HTTP_ prefix case 'CONTENT_TYPE': $headers['Content-Type'] = $value; break; @@ -170,21 +174,21 @@ class Sapi $headers['Content-Length'] = $value; break; - // mod_php on apache will put credentials in these variables. - // (fast)cgi does not usually do this, however. + // mod_php on apache will put credentials in these variables. + // (fast)cgi does not usually do this, however. case 'PHP_AUTH_USER': if (isset($serverArray['PHP_AUTH_PW'])) { $headers['Authorization'] = 'Basic '.base64_encode($value.':'.$serverArray['PHP_AUTH_PW']); } break; - // Similarly, mod_php may also screw around with digest auth. + // Similarly, mod_php may also screw around with digest auth. case 'PHP_AUTH_DIGEST': $headers['Authorization'] = 'Digest '.$value; break; - // Apache may prefix the HTTP_AUTHORIZATION header with - // REDIRECT_, if mod_rewrite was used. + // Apache may prefix the HTTP_AUTHORIZATION header with + // REDIRECT_, if mod_rewrite was used. case 'REDIRECT_HTTP_AUTHORIZATION': $headers['Authorization'] = $value; break; @@ -220,11 +224,11 @@ class Sapi } if (null === $url) { - throw new InvalidArgumentException('The _SERVER array must have a REQUEST_URI key'); + throw new \InvalidArgumentException('The _SERVER array must have a REQUEST_URI key'); } if (null === $method) { - throw new InvalidArgumentException('The _SERVER array must have a REQUEST_METHOD key'); + throw new \InvalidArgumentException('The _SERVER array must have a REQUEST_METHOD key'); } $r = new Request($method, $url, $headers); $r->setHttpVersion($httpVersion); diff --git a/vendor/sabre/http/lib/Version.php b/vendor/sabre/http/lib/Version.php index 47582f22e..4ac82f6d7 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.6'; + public const VERSION = '5.1.12'; } diff --git a/vendor/sabre/http/lib/functions.php b/vendor/sabre/http/lib/functions.php index d0477d943..9ecc1758a 100644 --- a/vendor/sabre/http/lib/functions.php +++ b/vendor/sabre/http/lib/functions.php @@ -4,9 +4,6 @@ declare(strict_types=1); namespace Sabre\HTTP; -use DateTime; -use InvalidArgumentException; - /** * A collection of useful helpers for parsing or generating various HTTP * headers. @@ -29,7 +26,7 @@ use InvalidArgumentException; * See: * http://tools.ietf.org/html/rfc7231#section-7.1.1.1 * - * @return bool|DateTime + * @return bool|\DateTime */ function parseDate(string $dateString) { @@ -65,7 +62,7 @@ function parseDate(string $dateString) } try { - return new DateTime($dateString, new \DateTimeZone('UTC')); + return new \DateTime($dateString, new \DateTimeZone('UTC')); } catch (\Exception $e) { return false; } @@ -74,7 +71,7 @@ function parseDate(string $dateString) /** * Transforms a DateTime object to a valid HTTP/1.1 Date header value. */ -function toDate(DateTime $dateTime): string +function toDate(\DateTime $dateTime): string { // We need to clone it, as we don't want to affect the existing // DateTime. @@ -171,9 +168,9 @@ function negotiateContentType($acceptHeaderValue, array $availableOptions) // Does this entry win? if ( - ($proposal['quality'] > $lastQuality) || - ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity) || - ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex) + ($proposal['quality'] > $lastQuality) + || ($proposal['quality'] === $lastQuality && $specificity > $lastSpecificity) + || ($proposal['quality'] === $lastQuality && $specificity === $lastSpecificity && $optionIndex < $lastOptionIndex) ) { $lastQuality = $proposal['quality']; $lastSpecificity = $specificity; @@ -331,7 +328,7 @@ function parseMimeType(string $str): array if (2 !== count($mimeType)) { // Illegal value var_dump($mimeType); - exit(); + exit; // throw new InvalidArgumentException('Not a valid mime-type: '.$str); } list($type, $subType) = $mimeType; diff --git a/vendor/sabre/uri/.php-cs-fixer.dist.php b/vendor/sabre/uri/.php-cs-fixer.dist.php index 87337520b..f9d4b7a8d 100644 --- a/vendor/sabre/uri/.php-cs-fixer.dist.php +++ b/vendor/sabre/uri/.php-cs-fixer.dist.php @@ -7,7 +7,11 @@ $finder = PhpCsFixer\Finder::create() $config = new PhpCsFixer\Config(); $config->setRules([ '@PSR1' => true, - '@Symfony' => true + '@Symfony' => true, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, ]); $config->setFinder($finder); return $config;
\ No newline at end of file diff --git a/vendor/sabre/uri/composer.json b/vendor/sabre/uri/composer.json index 0e0cf2d36..ba4a8e093 100644 --- a/vendor/sabre/uri/composer.json +++ b/vendor/sabre/uri/composer.json @@ -37,9 +37,12 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.9", - "phpstan/phpstan": "^1.8", - "phpunit/phpunit" : "^9.0" + "friendsofphp/php-cs-fixer": "^3.63", + "phpstan/phpstan": "^1.12", + "phpstan/phpstan-phpunit": "^1.4", + "phpstan/phpstan-strict-rules": "^1.6", + "phpstan/extension-installer": "^1.4", + "phpunit/phpunit" : "^9.6" }, "scripts": { "phpstan": [ @@ -56,5 +59,10 @@ "composer cs-fixer", "composer phpunit" ] + }, + "config": { + "allow-plugins": { + "phpstan/extension-installer": true + } } } diff --git a/vendor/sabre/uri/lib/Version.php b/vendor/sabre/uri/lib/Version.php index e4f289e90..c7652f4f2 100644 --- a/vendor/sabre/uri/lib/Version.php +++ b/vendor/sabre/uri/lib/Version.php @@ -16,5 +16,5 @@ class Version /** * Full version number. */ - public const VERSION = '2.3.2'; + public const VERSION = '2.3.4'; } diff --git a/vendor/sabre/uri/lib/functions.php b/vendor/sabre/uri/lib/functions.php index 64e64027f..ce3027e2e 100644 --- a/vendor/sabre/uri/lib/functions.php +++ b/vendor/sabre/uri/lib/functions.php @@ -26,15 +26,15 @@ function resolve(string $basePath, string $newPath): string // If the new path defines a scheme, it's absolute and we can just return // that. - if ($delta['scheme']) { + if (null !== $delta['scheme']) { return build($delta); } $base = parse($basePath); $pick = function ($part) use ($base, $delta) { - if ($delta[$part]) { + if (null !== $delta[$part]) { return $delta[$part]; - } elseif ($base[$part]) { + } elseif (null !== $base[$part]) { return $base[$part]; } @@ -47,7 +47,6 @@ function resolve(string $basePath, string $newPath): string $newParts['host'] = $pick('host'); $newParts['port'] = $pick('port'); - $path = ''; if (is_string($delta['path']) and strlen($delta['path']) > 0) { // If the path starts with a slash if ('/' === $delta['path'][0]) { @@ -62,7 +61,10 @@ function resolve(string $basePath, string $newPath): string $path .= '/'.$delta['path']; } } else { - $path = $base['path'] ?: '/'; + $path = $base['path'] ?? '/'; + if ('' === $path) { + $path = '/'; + } } // Removing .. and . $pathParts = explode('/', $path); @@ -85,13 +87,17 @@ function resolve(string $basePath, string $newPath): string // If the source url ended with a /, we want to preserve that. $newParts['path'] = 0 === strpos($path, '/') ? $path : '/'.$path; - if ($delta['query']) { + // From PHP 8, no "?" query at all causes 'query' to be null. + // An empty query "http://example.com/foo?" causes 'query' to be the empty string + if (null !== $delta['query'] && '' !== $delta['query']) { $newParts['query'] = $delta['query']; - } elseif (!empty($base['query']) && empty($delta['host']) && empty($delta['path'])) { + } elseif (isset($base['query']) && null === $delta['host'] && null === $delta['path']) { // Keep the old query if host and path didn't change $newParts['query'] = $base['query']; } - if ($delta['fragment']) { + // From PHP 8, no "#" fragment at all causes 'fragment' to be null. + // An empty fragment "http://example.com/foo#" causes 'fragment' to be the empty string + if (null !== $delta['fragment'] && '' !== $delta['fragment']) { $newParts['fragment'] = $delta['fragment']; } @@ -113,7 +119,7 @@ function normalize(string $uri): string { $parts = parse($uri); - if (!empty($parts['path'])) { + if (null !== $parts['path']) { $pathParts = explode('/', ltrim($parts['path'], '/')); $newPathParts = []; foreach ($pathParts as $pathPart) { @@ -134,14 +140,14 @@ function normalize(string $uri): string $parts['path'] = '/'.implode('/', $newPathParts); } - if ($parts['scheme']) { + if (null !== $parts['scheme']) { $parts['scheme'] = strtolower($parts['scheme']); $defaultPorts = [ 'http' => '80', 'https' => '443', ]; - if (!empty($parts['port']) && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { + if (null !== $parts['port'] && isset($defaultPorts[$parts['scheme']]) && $defaultPorts[$parts['scheme']] == $parts['port']) { // Removing default ports. unset($parts['port']); } @@ -149,7 +155,7 @@ function normalize(string $uri): string switch ($parts['scheme']) { case 'http': case 'https': - if (empty($parts['path'])) { + if (null === $parts['path']) { // An empty path is equivalent to / in http. $parts['path'] = '/'; } @@ -157,7 +163,7 @@ function normalize(string $uri): string } } - if ($parts['host']) { + if (null !== $parts['host']) { $parts['host'] = strtolower($parts['host']); } @@ -201,7 +207,7 @@ function parse(string $uri): array } $result = parse_url($uri); - if (!$result) { + if (false === $result) { $result = _parse_fallback($uri); } @@ -217,14 +223,14 @@ function parse(string $uri): array */ return $result + [ - 'scheme' => null, - 'host' => null, - 'path' => null, - 'port' => null, - 'user' => null, - 'query' => null, - 'fragment' => null, - ]; + 'scheme' => null, + 'host' => null, + 'path' => null, + 'port' => null, + 'user' => null, + 'query' => null, + 'fragment' => null, + ]; } /** @@ -238,32 +244,32 @@ function build(array $parts): string $uri = ''; $authority = ''; - if (!empty($parts['host'])) { + if (isset($parts['host'])) { $authority = $parts['host']; - if (!empty($parts['user'])) { + if (isset($parts['user'])) { $authority = $parts['user'].'@'.$authority; } - if (!empty($parts['port'])) { + if (isset($parts['port'])) { $authority = $authority.':'.$parts['port']; } } - if (!empty($parts['scheme'])) { + if (isset($parts['scheme'])) { // If there's a scheme, there's also a host. $uri = $parts['scheme'].':'; } - if ($authority || (!empty($parts['scheme']) && 'file' === $parts['scheme'])) { + if ('' !== $authority || (isset($parts['scheme']) && 'file' === $parts['scheme'])) { // No scheme, but there is a host. $uri .= '//'.$authority; } - if (!empty($parts['path'])) { + if (isset($parts['path'])) { $uri .= $parts['path']; } - if (!empty($parts['query'])) { + if (isset($parts['query'])) { $uri .= '?'.$parts['query']; } - if (!empty($parts['fragment'])) { + if (isset($parts['fragment'])) { $uri .= '#'.$parts['fragment']; } @@ -290,7 +296,7 @@ function build(array $parts): string function split(string $path): array { $matches = []; - if (preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { + if (1 === preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u', $path, $matches)) { return [$matches[1], $matches[2]]; } @@ -307,7 +313,7 @@ function split(string $path): array * This function is only called if the main parse method fails. It's pretty * crude and probably slow, so the original parse_url is usually preferred. * - * @return array<string, mixed> + * @return array{scheme: string|null, host: string|null, path: string|null, port: positive-int|null, user: string|null, query: string|null, fragment: string|null} * * @throws InvalidUriException */ @@ -340,10 +346,14 @@ function _parse_fallback(string $uri): array 'query' => null, ]; - if (preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { + if (1 === preg_match('% ^([A-Za-z][A-Za-z0-9+-\.]+): %x', $uri, $matches)) { $result['scheme'] = $matches[1]; // Take what's left. $uri = substr($uri, strlen($result['scheme']) + 1); + if (false === $uri) { + // There was nothing left. + $uri = ''; + } } // Taking off a fragment part @@ -358,7 +368,11 @@ function _parse_fallback(string $uri): array if ('///' === substr($uri, 0, 3)) { // The triple slash uris are a bit unusual, but we have special handling // for them. - $result['path'] = substr($uri, 2); + $path = substr($uri, 2); + if (false === $path) { + throw new \RuntimeException('The string cannot be false'); + } + $result['path'] = $path; $result['host'] = ''; } elseif ('//' === substr($uri, 0, 2)) { // Uris that have an authority part. @@ -369,22 +383,25 @@ function _parse_fallback(string $uri): array (?: : (?<port> [0-9]+))? (?<path> / .*)? $%x'; - if (!preg_match($regex, $uri, $matches)) { + if (1 !== preg_match($regex, $uri, $matches)) { throw new InvalidUriException('Invalid, or could not parse URI'); } - if ($matches['host']) { + if (isset($matches['host']) && '' !== $matches['host']) { $result['host'] = $matches['host']; } if (isset($matches['port'])) { - $result['port'] = (int) $matches['port']; + $port = (int) $matches['port']; + if ($port > 0) { + $result['port'] = $port; + } } if (isset($matches['path'])) { $result['path'] = $matches['path']; } - if ($matches['user']) { + if (isset($matches['user']) && '' !== $matches['user']) { $result['user'] = $matches['user']; } - if ($matches['pass']) { + if (isset($matches['pass']) && '' !== $matches['pass']) { $result['pass'] = $matches['pass']; } } else { diff --git a/vendor/sabre/vobject/composer.json b/vendor/sabre/vobject/composer.json index b08684bce..df0261feb 100644 --- a/vendor/sabre/vobject/composer.json +++ b/vendor/sabre/vobject/composer.json @@ -38,9 +38,9 @@ }, "require-dev" : { "friendsofphp/php-cs-fixer": "~2.17.1", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0", + "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6", "phpunit/php-invoker" : "^2.0 || ^3.1", - "phpstan/phpstan": "^0.12" + "phpstan/phpstan": "^0.12 || ^1.11" }, "suggest" : { "hoa/bench" : "If you would like to run the benchmark scripts" diff --git a/vendor/sabre/vobject/lib/Component/VCalendar.php b/vendor/sabre/vobject/lib/Component/VCalendar.php index 4db318135..017aed70c 100644 --- a/vendor/sabre/vobject/lib/Component/VCalendar.php +++ b/vendor/sabre/vobject/lib/Component/VCalendar.php @@ -281,7 +281,7 @@ class VCalendar extends VObject\Document * * @return VCalendar */ - public function expand(DateTimeInterface $start, DateTimeInterface $end, DateTimeZone $timeZone = null) + public function expand(DateTimeInterface $start, DateTimeInterface $end, ?DateTimeZone $timeZone = null) { $newChildren = []; $recurringEvents = []; diff --git a/vendor/sabre/vobject/lib/DateTimeParser.php b/vendor/sabre/vobject/lib/DateTimeParser.php index c5dbac97d..69072ef8c 100644 --- a/vendor/sabre/vobject/lib/DateTimeParser.php +++ b/vendor/sabre/vobject/lib/DateTimeParser.php @@ -31,7 +31,7 @@ class DateTimeParser * * @return DateTimeImmutable */ - public static function parseDateTime($dt, DateTimeZone $tz = null) + public static function parseDateTime($dt, ?DateTimeZone $tz = null) { // Format is YYYYMMDD + "T" + hhmmss $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])T([0-2][0-9])([0-5][0-9])([0-5][0-9])([Z]?)$/', $dt, $matches); @@ -61,7 +61,7 @@ class DateTimeParser * * @return DateTimeImmutable */ - public static function parseDate($date, DateTimeZone $tz = null) + public static function parseDate($date, ?DateTimeZone $tz = null) { // Format is YYYYMMDD $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/', $date, $matches); diff --git a/vendor/sabre/vobject/lib/Document.php b/vendor/sabre/vobject/lib/Document.php index 6b908c70e..d2131f479 100644 --- a/vendor/sabre/vobject/lib/Document.php +++ b/vendor/sabre/vobject/lib/Document.php @@ -157,7 +157,7 @@ abstract class Document extends Component * * @return Component */ - public function createComponent($name, array $children = null, $defaults = true) + public function createComponent($name, ?array $children = null, $defaults = true) { $name = strtoupper($name); $class = Component::class; @@ -187,7 +187,7 @@ abstract class Document extends Component * @param array $parameters * @param string $valueType Force a specific valuetype, such as URI or TEXT */ - public function createProperty($name, $value = null, array $parameters = null, $valueType = null, int $lineIndex = null, string $lineString = null): Property + public function createProperty($name, $value = null, ?array $parameters = null, $valueType = null, ?int $lineIndex = null, ?string $lineString = null): Property { // If there's a . in the name, it means it's prefixed by a groupname. if (false !== ($i = strpos($name, '.'))) { diff --git a/vendor/sabre/vobject/lib/FreeBusyGenerator.php b/vendor/sabre/vobject/lib/FreeBusyGenerator.php index 81b8126d5..56ae166fa 100644 --- a/vendor/sabre/vobject/lib/FreeBusyGenerator.php +++ b/vendor/sabre/vobject/lib/FreeBusyGenerator.php @@ -89,7 +89,7 @@ class FreeBusyGenerator * @param mixed $objects * @param DateTimeZone $timeZone */ - public function __construct(DateTimeInterface $start = null, DateTimeInterface $end = null, $objects = null, DateTimeZone $timeZone = null) + public function __construct(?DateTimeInterface $start = null, ?DateTimeInterface $end = null, $objects = null, ?DateTimeZone $timeZone = null) { $this->setTimeRange($start, $end); @@ -158,7 +158,7 @@ class FreeBusyGenerator * @param DateTimeInterface $start * @param DateTimeInterface $end */ - public function setTimeRange(DateTimeInterface $start = null, DateTimeInterface $end = null) + public function setTimeRange(?DateTimeInterface $start = null, ?DateTimeInterface $end = null) { if (!$start) { $start = new DateTimeImmutable(Settings::$minDate); diff --git a/vendor/sabre/vobject/lib/ITip/Broker.php b/vendor/sabre/vobject/lib/ITip/Broker.php index dbdd80b78..9d68fc4c6 100644 --- a/vendor/sabre/vobject/lib/ITip/Broker.php +++ b/vendor/sabre/vobject/lib/ITip/Broker.php @@ -108,7 +108,7 @@ class Broker * * @return VCalendar|null */ - public function processMessage(Message $itipMessage, VCalendar $existingObject = null) + public function processMessage(Message $itipMessage, ?VCalendar $existingObject = null) { // We only support events at the moment. if ('VEVENT' !== $itipMessage->component) { @@ -266,7 +266,7 @@ class Broker * * @return VCalendar|null */ - protected function processMessageRequest(Message $itipMessage, VCalendar $existingObject = null) + protected function processMessageRequest(Message $itipMessage, ?VCalendar $existingObject = null) { if (!$existingObject) { // This is a new invite, and we're just going to copy over @@ -301,7 +301,7 @@ class Broker * * @return VCalendar|null */ - protected function processMessageCancel(Message $itipMessage, VCalendar $existingObject = null) + protected function processMessageCancel(Message $itipMessage, ?VCalendar $existingObject = null) { if (!$existingObject) { // The event didn't exist in the first place, so we're just @@ -326,7 +326,7 @@ class Broker * * @return VCalendar|null */ - protected function processMessageReply(Message $itipMessage, VCalendar $existingObject = null) + protected function processMessageReply(Message $itipMessage, ?VCalendar $existingObject = null) { // A reply can only be processed based on an existing object. // If the object is not available, the reply is ignored. @@ -510,10 +510,11 @@ class Broker $icalMsg->add(clone $timezone); } - if (!$attendee['newInstances']) { - // If there are no instances the attendee is a part of, it - // means the attendee was removed and we need to send him a - // CANCEL. + if (!$attendee['newInstances'] || 'CANCELLED' === $eventInfo['status']) { + // If there are no instances the attendee is a part of, it means + // the attendee was removed and we need to send them a CANCEL message. + // Also If the meeting STATUS property was changed to CANCELLED + // we need to send the attendee a CANCEL message. $message->method = 'CANCEL'; $icalMsg->METHOD = $message->method; @@ -807,7 +808,7 @@ class Broker * * @return array */ - protected function parseEventInfo(VCalendar $calendar = null) + protected function parseEventInfo(?VCalendar $calendar = null) { $uid = null; $organizer = null; diff --git a/vendor/sabre/vobject/lib/Property.php b/vendor/sabre/vobject/lib/Property.php index 0805c139a..f52760f9c 100644 --- a/vendor/sabre/vobject/lib/Property.php +++ b/vendor/sabre/vobject/lib/Property.php @@ -81,7 +81,7 @@ abstract class Property extends Node * @param array $parameters List of parameters * @param string $group The vcard property group */ - public function __construct(Component $root, $name, $value = null, array $parameters = [], $group = null, int $lineIndex = null, string $lineString = null) + public function __construct(Component $root, $name, $value = null, array $parameters = [], $group = null, ?int $lineIndex = null, ?string $lineString = null) { $this->name = $name; $this->group = $group; diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php index ca71633b9..3ea21e2ec 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/DateTime.php @@ -131,7 +131,7 @@ class DateTime extends Property * * @return \DateTimeImmutable */ - public function getDateTime(DateTimeZone $timeZone = null) + public function getDateTime(?DateTimeZone $timeZone = null) { $dt = $this->getDateTimes($timeZone); if (!$dt) { @@ -153,7 +153,7 @@ class DateTime extends Property * @return \DateTimeImmutable[] * @return \DateTime[] */ - public function getDateTimes(DateTimeZone $timeZone = null) + public function getDateTimes(?DateTimeZone $timeZone = null) { // Does the property have a TZID? $tzid = $this['TZID']; diff --git a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php index 3d632fec1..cd3d7a5e4 100644 --- a/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php +++ b/vendor/sabre/vobject/lib/Property/ICalendar/Recur.php @@ -2,6 +2,7 @@ namespace Sabre\VObject\Property\ICalendar; +use Sabre\VObject\InvalidDataException; use Sabre\VObject\Property; use Sabre\Xml; @@ -198,7 +199,14 @@ class Recur extends Property if (empty($part)) { continue; } - list($partName, $partValue) = explode('=', $part); + + $parts = explode('=', $part); + + if (2 !== count($parts)) { + throw new InvalidDataException('The supplied iCalendar RRULE part is incorrect: '.$part); + } + + list($partName, $partValue) = $parts; // The value itself had multiple values.. if (false !== strpos($partValue, ',')) { diff --git a/vendor/sabre/vobject/lib/Recur/EventIterator.php b/vendor/sabre/vobject/lib/Recur/EventIterator.php index 61f05d7de..55d6e4779 100644 --- a/vendor/sabre/vobject/lib/Recur/EventIterator.php +++ b/vendor/sabre/vobject/lib/Recur/EventIterator.php @@ -93,7 +93,7 @@ class EventIterator implements \Iterator * @param DateTimeZone $timeZone reference timezone for floating dates and * times */ - public function __construct($input, $uid = null, DateTimeZone $timeZone = null) + public function __construct($input, $uid = null, ?DateTimeZone $timeZone = null) { if (is_null($timeZone)) { $timeZone = new DateTimeZone('UTC'); diff --git a/vendor/sabre/vobject/lib/TimeZoneUtil.php b/vendor/sabre/vobject/lib/TimeZoneUtil.php index 6422c0930..0d77e71ed 100644 --- a/vendor/sabre/vobject/lib/TimeZoneUtil.php +++ b/vendor/sabre/vobject/lib/TimeZoneUtil.php @@ -75,7 +75,7 @@ class TimeZoneUtil * 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 + private function findTimeZone(string $tzid, ?Component $vcalendar = null, bool $failIfUncertain = false): DateTimeZone { foreach ($this->timezoneFinders as $timezoneFinder) { $timezone = $timezoneFinder->find($tzid, $failIfUncertain); @@ -126,7 +126,7 @@ class TimeZoneUtil * * @return DateTimeZone */ - public static function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) + public static function getTimeZone($tzid, ?Component $vcalendar = null, $failIfUncertain = false) { return self::getInstance()->findTimeZone($tzid, $vcalendar, $failIfUncertain); } diff --git a/vendor/sabre/vobject/lib/Version.php b/vendor/sabre/vobject/lib/Version.php index 309b995cf..060c69a30 100644 --- a/vendor/sabre/vobject/lib/Version.php +++ b/vendor/sabre/vobject/lib/Version.php @@ -14,5 +14,5 @@ class Version /** * Full version number. */ - public const VERSION = '4.5.5'; + public const VERSION = '4.5.6'; } diff --git a/vendor/sabre/xml/.github/workflows/ci.yml b/vendor/sabre/xml/.github/workflows/ci.yml index 3473cd2de..5775abaf8 100644 --- a/vendor/sabre/xml/.github/workflows/ci.yml +++ b/vendor/sabre/xml/.github/workflows/ci.yml @@ -12,16 +12,22 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] coverage: ['pcov'] + code-style: ['yes'] code-analysis: ['no'] include: - php-versions: '7.1' coverage: 'none' + code-style: 'yes' + code-analysis: 'yes' + - php-versions: '8.4' + coverage: 'pcov' + code-style: 'yes' code-analysis: 'yes' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup PHP, with composer and extensions uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php @@ -36,7 +42,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -48,8 +54,8 @@ jobs: 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 + if: matrix.code-style == 'yes' + run: PHP_CS_FIXER_IGNORE_ENV=true php vendor/bin/php-cs-fixer fix --dry-run --diff - name: Code Analysis (PHPStan) if: matrix.code-analysis == 'yes' @@ -59,5 +65,5 @@ jobs: run: vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover clover.xml - name: Code Coverage - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v3 if: matrix.coverage != 'none' diff --git a/vendor/sabre/xml/.php-cs-fixer.dist.php b/vendor/sabre/xml/.php-cs-fixer.dist.php new file mode 100644 index 000000000..f9d4b7a8d --- /dev/null +++ b/vendor/sabre/xml/.php-cs-fixer.dist.php @@ -0,0 +1,17 @@ +<?php + +$finder = PhpCsFixer\Finder::create() + ->exclude('vendor') + ->in(__DIR__); + +$config = new PhpCsFixer\Config(); +$config->setRules([ + '@PSR1' => true, + '@Symfony' => true, + 'nullable_type_declaration' => [ + 'syntax' => 'question_mark', + ], + 'nullable_type_declaration_for_default_null_value' => true, +]); +$config->setFinder($finder); +return $config;
\ No newline at end of file diff --git a/vendor/sabre/xml/composer.json b/vendor/sabre/xml/composer.json index 4524cf59b..d7577c2cf 100644 --- a/vendor/sabre/xml/composer.json +++ b/vendor/sabre/xml/composer.json @@ -44,16 +44,16 @@ } }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.17.1", + "friendsofphp/php-cs-fixer": "~2.17.1||3.63.2", "phpstan/phpstan": "^0.12", - "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.0" + "phpunit/phpunit" : "^7.5 || ^8.5 || ^9.6" }, "scripts": { "phpstan": [ "phpstan analyse lib tests" ], "cs-fixer": [ - "php-cs-fixer fix" + "PHP_CS_FIXER_IGNORE_ENV=true php-cs-fixer fix" ], "phpunit": [ "phpunit --configuration tests/phpunit.xml" diff --git a/vendor/sabre/xml/lib/Deserializer/functions.php b/vendor/sabre/xml/lib/Deserializer/functions.php index c4f240970..50818098b 100644 --- a/vendor/sabre/xml/lib/Deserializer/functions.php +++ b/vendor/sabre/xml/lib/Deserializer/functions.php @@ -55,7 +55,7 @@ use Sabre\Xml\Reader; * Attributes will be removed from the top-level elements. If elements with * the same name appear twice in the list, only the last one will be kept. */ -function keyValue(Reader $reader, string $namespace = null): array +function keyValue(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -144,7 +144,7 @@ function keyValue(Reader $reader, string $namespace = null): array * * @return string[] */ -function enum(Reader $reader, string $namespace = null): array +function enum(Reader $reader, ?string $namespace = null): array { // If there's no children, we don't do anything. if ($reader->isEmptyElement) { @@ -215,8 +215,11 @@ function valueObject(Reader $reader, string $className, string $namespace) // Ignore property $reader->next(); } + } elseif (Reader::ELEMENT === $reader->nodeType) { + // Skipping element from different namespace + $reader->next(); } else { - if (!$reader->read()) { + if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) { break; } } @@ -322,8 +325,6 @@ function mixedContent(Reader $reader): array * * You can use, e.g., a named constructor (factory method) to create an object using * this function. - * - * @return mixed */ function functionCaller(Reader $reader, callable $func, string $namespace) { diff --git a/vendor/sabre/xml/lib/Element/Base.php b/vendor/sabre/xml/lib/Element/Base.php index 8a93191b1..02fd76966 100644 --- a/vendor/sabre/xml/lib/Element/Base.php +++ b/vendor/sabre/xml/lib/Element/Base.php @@ -21,8 +21,6 @@ class Base implements Xml\Element { /** * PHP value to serialize. - * - * @var mixed */ protected $value; @@ -72,8 +70,6 @@ class Base implements Xml\Element * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Xml\Reader $reader) { diff --git a/vendor/sabre/xml/lib/Element/Elements.php b/vendor/sabre/xml/lib/Element/Elements.php index fecce4c75..6915fd462 100644 --- a/vendor/sabre/xml/lib/Element/Elements.php +++ b/vendor/sabre/xml/lib/Element/Elements.php @@ -90,8 +90,6 @@ class Elements implements Xml\Element * * $reader->parseSubTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Xml\Reader $reader) { diff --git a/vendor/sabre/xml/lib/Element/KeyValue.php b/vendor/sabre/xml/lib/Element/KeyValue.php index 17448880d..7d75a3ac8 100644 --- a/vendor/sabre/xml/lib/Element/KeyValue.php +++ b/vendor/sabre/xml/lib/Element/KeyValue.php @@ -90,8 +90,6 @@ class KeyValue implements Xml\Element * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Xml\Reader $reader) { diff --git a/vendor/sabre/xml/lib/Element/Uri.php b/vendor/sabre/xml/lib/Element/Uri.php index 336212a53..65276380e 100644 --- a/vendor/sabre/xml/lib/Element/Uri.php +++ b/vendor/sabre/xml/lib/Element/Uri.php @@ -84,8 +84,6 @@ class Uri implements Xml\Element * * $reader->parseSubTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Xml\Reader $reader) { diff --git a/vendor/sabre/xml/lib/Element/XmlFragment.php b/vendor/sabre/xml/lib/Element/XmlFragment.php index bf110eaee..99d1f87f9 100644 --- a/vendor/sabre/xml/lib/Element/XmlFragment.php +++ b/vendor/sabre/xml/lib/Element/XmlFragment.php @@ -135,8 +135,6 @@ XML; * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader) { diff --git a/vendor/sabre/xml/lib/LibXMLException.php b/vendor/sabre/xml/lib/LibXMLException.php index fb074f97d..993f95fd9 100644 --- a/vendor/sabre/xml/lib/LibXMLException.php +++ b/vendor/sabre/xml/lib/LibXMLException.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace Sabre\Xml; use LibXMLError; -use Throwable; /** * This exception is thrown when the Reader runs into a parsing error. @@ -30,10 +29,9 @@ class LibXMLException extends ParseException * * You should pass a list of LibXMLError objects in its constructor. * - * @param LibXMLError[] $errors - * @param Throwable $previousException + * @param \LibXMLError[] $errors */ - public function __construct(array $errors, int $code = 0, Throwable $previousException = null) + public function __construct(array $errors, int $code = 0, ?\Throwable $previousException = null) { $this->errors = $errors; parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException); diff --git a/vendor/sabre/xml/lib/ParseException.php b/vendor/sabre/xml/lib/ParseException.php index e237b8732..158cf0119 100644 --- a/vendor/sabre/xml/lib/ParseException.php +++ b/vendor/sabre/xml/lib/ParseException.php @@ -13,6 +13,6 @@ use Exception; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class ParseException extends Exception +class ParseException extends \Exception { } diff --git a/vendor/sabre/xml/lib/Reader.php b/vendor/sabre/xml/lib/Reader.php index 7871a74f5..f680bf4cd 100644 --- a/vendor/sabre/xml/lib/Reader.php +++ b/vendor/sabre/xml/lib/Reader.php @@ -19,7 +19,7 @@ use XMLReader; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Reader extends XMLReader +class Reader extends \XMLReader { use ContextStackTrait; @@ -103,7 +103,7 @@ class Reader extends XMLReader * If the $elementMap argument is specified, the existing elementMap will * be overridden while parsing the tree, and restored after this process. */ - public function parseGetElements(array $elementMap = null): array + public function parseGetElements(?array $elementMap = null): array { $result = $this->parseInnerTree($elementMap); if (!is_array($result)) { @@ -126,7 +126,7 @@ class Reader extends XMLReader * * @return array|string|null */ - public function parseInnerTree(array $elementMap = null) + public function parseInnerTree(?array $elementMap = null) { $text = null; $elements = []; @@ -205,7 +205,7 @@ class Reader extends XMLReader $previousDepth = $this->depth; while ($this->read() && $this->depth != $previousDepth) { - if (in_array($this->nodeType, [XMLReader::TEXT, XMLReader::CDATA, XMLReader::WHITESPACE])) { + if (in_array($this->nodeType, [\XMLReader::TEXT, \XMLReader::CDATA, \XMLReader::WHITESPACE])) { $result .= $this->value; } } diff --git a/vendor/sabre/xml/lib/Serializer/functions.php b/vendor/sabre/xml/lib/Serializer/functions.php index 8d0330558..23f22d4c8 100644 --- a/vendor/sabre/xml/lib/Serializer/functions.php +++ b/vendor/sabre/xml/lib/Serializer/functions.php @@ -4,7 +4,6 @@ declare(strict_types=1); namespace Sabre\Xml\Serializer; -use InvalidArgumentException; use Sabre\Xml\Writer; use Sabre\Xml\XmlSerializable; @@ -197,12 +196,12 @@ function standardSerializer(Writer $writer, $value) $writer->write($item); $writer->endElement(); } else { - throw new InvalidArgumentException('The writer does not know how to serialize arrays with keys of type: '.gettype($name)); + throw new \InvalidArgumentException('The writer does not know how to serialize arrays with keys of type: '.gettype($name)); } } } elseif (is_object($value)) { - throw new InvalidArgumentException('The writer cannot serialize objects of class: '.get_class($value)); + throw new \InvalidArgumentException('The writer cannot serialize objects of class: '.get_class($value)); } elseif (!is_null($value)) { - throw new InvalidArgumentException('The writer cannot serialize values of type: '.gettype($value)); + throw new \InvalidArgumentException('The writer cannot serialize values of type: '.gettype($value)); } } diff --git a/vendor/sabre/xml/lib/Service.php b/vendor/sabre/xml/lib/Service.php index a8e34d254..6e522630e 100644 --- a/vendor/sabre/xml/lib/Service.php +++ b/vendor/sabre/xml/lib/Service.php @@ -105,16 +105,23 @@ class Service * * @param string|resource $input * - * @throws ParseException - * * @return array|object|string + * + * @throws ParseException */ - public function parse($input, string $contextUri = null, string &$rootElementName = null) + public function parse($input, ?string $contextUri = null, ?string &$rootElementName = null) { - if (is_resource($input)) { + if (!is_string($input)) { // Unfortunately the XMLReader doesn't support streams. When it // does, we can optimize this. - $input = (string) stream_get_contents($input); + if (is_resource($input)) { + $input = (string) stream_get_contents($input); + } else { + // Input is not a string and not a resource. + // Therefore, it has to be a closed resource. + // Effectively empty input has been passed in. + $input = ''; + } } // If input is empty, then it's safe to throw an exception @@ -149,16 +156,23 @@ class Service * @param string|string[] $rootElementName * @param string|resource $input * - * @throws ParseException - * * @return array|object|string + * + * @throws ParseException */ - public function expect($rootElementName, $input, string $contextUri = null) + public function expect($rootElementName, $input, ?string $contextUri = null) { - if (is_resource($input)) { + if (!is_string($input)) { // Unfortunately the XMLReader doesn't support streams. When it // does, we can optimize this. - $input = (string) stream_get_contents($input); + if (is_resource($input)) { + $input = (string) stream_get_contents($input); + } else { + // Input is not a string and not a resource. + // Therefore, it has to be a closed resource. + // Effectively empty input has been passed in. + $input = ''; + } } // If input is empty, then it's safe to throw an exception @@ -204,7 +218,7 @@ class Service * * @return string */ - public function write(string $rootElementName, $value, string $contextUri = null) + public function write(string $rootElementName, $value, ?string $contextUri = null) { $w = $this->getWriter(); $w->openMemory(); @@ -266,7 +280,7 @@ class Service * * @throws \InvalidArgumentException */ - public function writeValueObject($object, string $contextUri = null) + public function writeValueObject($object, ?string $contextUri = null) { if (!isset($this->valueObjectMap[get_class($object)])) { throw new \InvalidArgumentException('"'.get_class($object).'" is not a registered value object class. Register your class with mapValueObject.'); diff --git a/vendor/sabre/xml/lib/Version.php b/vendor/sabre/xml/lib/Version.php index 1144bf085..c2da842ec 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.5'; + public const VERSION = '2.2.11'; } diff --git a/vendor/sabre/xml/lib/Writer.php b/vendor/sabre/xml/lib/Writer.php index e3238a7ed..76989612e 100644 --- a/vendor/sabre/xml/lib/Writer.php +++ b/vendor/sabre/xml/lib/Writer.php @@ -30,7 +30,7 @@ use XMLWriter; * @author Evert Pot (http://evertpot.com/) * @license http://sabre.io/license/ Modified BSD License */ -class Writer extends XMLWriter +class Writer extends \XMLWriter { use ContextStackTrait; @@ -93,8 +93,6 @@ class Writer extends XMLWriter * ] * ] * ] - * - * @param mixed $value */ public function write($value) { @@ -151,7 +149,7 @@ class Writer extends XMLWriter if (!$this->namespacesWritten) { foreach ($this->namespaceMap as $namespace => $prefix) { - $this->writeAttribute(($prefix ? 'xmlns:'.$prefix : 'xmlns'), $namespace); + $this->writeAttribute($prefix ? 'xmlns:'.$prefix : 'xmlns', $namespace); } $this->namespacesWritten = true; } diff --git a/vendor/sabre/xml/lib/XmlDeserializable.php b/vendor/sabre/xml/lib/XmlDeserializable.php index 83f33db1e..0a5720334 100644 --- a/vendor/sabre/xml/lib/XmlDeserializable.php +++ b/vendor/sabre/xml/lib/XmlDeserializable.php @@ -31,8 +31,6 @@ interface XmlDeserializable * * $reader->parseInnerTree() will parse the entire sub-tree, and advance to * the next element. - * - * @return mixed */ public static function xmlDeserialize(Reader $reader); } |