From 7255dedbafbbb1db81745bdfde8aa8aaeb9f9846 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Mon, 13 Nov 2023 13:49:09 +0100 Subject: [PATCH 1/2] Declare properties of api_testable explicitly --- classes/local/api_testable.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/local/api_testable.php b/classes/local/api_testable.php index 56f6f83..11aef87 100644 --- a/classes/local/api_testable.php +++ b/classes/local/api_testable.php @@ -45,6 +45,17 @@ class api_testable extends api { /** @var string version api version to apply for */ public $version = '1.9.0'; + /** @var string the username. */ + private string $username; + /** @var string the password. */ + private string $password; + /** @var string the timeout. */ + private string $timeout; + /** @var string the connecttimeout. */ + private string $connecttimeout; + /** @var string the baseurl. */ + private string $baseurl; + /** * Constructor of the Opencast Test API. * From 65feb717fc8d8d892d82ca232fefa17bff6135b3 Mon Sep 17 00:00:00 2001 From: Justus Dieckmann Date: Mon, 13 Nov 2023 18:46:43 +0100 Subject: [PATCH 2/2] Update opencast-api to 1.5.0 --- composer.json | 2 +- composer.lock | 73 +++++------ vendor/autoload.php | 18 --- vendor/composer/ClassLoader.php | 41 ++---- vendor/composer/InstalledVersions.php | 33 ++--- vendor/composer/LICENSE | 2 - vendor/composer/autoload_classmap.php | 2 +- vendor/composer/autoload_files.php | 4 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 4 +- vendor/composer/autoload_real.php | 54 ++++++-- vendor/composer/autoload_static.php | 6 +- vendor/composer/installed.json | 81 ++++++------ vendor/composer/installed.php | 44 +++---- .../.github/workflows/opencast-php-lib-ci.yml | 60 +++++++++ vendor/elan-ev/opencast-api/CHANGELOG.md | 12 +- vendor/elan-ev/opencast-api/README.md | 57 +++++++-- vendor/elan-ev/opencast-api/composer.json | 10 +- vendor/elan-ev/opencast-api/composer.lock | 121 +++++++++++++++++- .../opencast-api/src/OpencastApi/Opencast.php | 79 ++++++++++-- .../OpencastApi/Rest/OcListProvidersApi.php | 50 ++++++++ .../src/OpencastApi/Rest/OcRest.php | 26 +++- .../src/OpencastApi/Rest/OcRestClient.php | 31 ++++- .../tests/DataProvider/EventsDataProvider.php | 8 +- .../tests/DataProvider/SetupDataProvider.php | 12 +- .../tests/Unit/OcAgentsApiTest.php | 6 +- .../opencast-api/tests/Unit/OcBaseApiTest.php | 6 +- .../tests/Unit/OcEventsApiTest.php | 33 +++-- .../tests/Unit/OcGroupsApiTest.php | 33 ++--- .../opencast-api/tests/Unit/OcIngestTest.php | 10 +- .../tests/Unit/OcListProvidersApiTest.php | 38 ++++++ .../opencast-api/tests/Unit/OcSearchTest.php | 6 +- .../tests/Unit/OcSecurityApiTest.php | 6 +- .../tests/Unit/OcSeriesApiTest.php | 22 +++- .../tests/Unit/OcServicesTest.php | 6 +- .../tests/Unit/OcStatisticsApiTest.php | 6 +- .../opencast-api/tests/Unit/OcSysinfoTest.php | 6 +- .../tests/Unit/OcWorkflowTest.php | 6 +- .../tests/Unit/OcWorkflowsApiTest.php | 27 +++- .../tests/UnitMock/OcAgentsApiTestMock.php | 6 +- .../tests/UnitMock/OcBaseApiTestMock.php | 6 +- .../tests/UnitMock/OcEventsApiTestMock.php | 18 +-- .../tests/UnitMock/OcGroupsApiTestMock.php | 8 +- .../tests/UnitMock/OcIngestTestMock.php | 12 +- .../tests/UnitMock/OcSearchTestMock.php | 6 +- .../tests/UnitMock/OcSecurityApiTestMock.php | 6 +- .../tests/UnitMock/OcSeriesApiTestMock.php | 10 +- .../tests/UnitMock/OcServicesTestMock.php | 6 +- .../UnitMock/OcStatisticsApiTestMock.php | 6 +- .../tests/UnitMock/OcSysinfoTestMock.php | 6 +- .../tests/UnitMock/OcWorkflowsApiTestMock.php | 8 +- vendor/guzzlehttp/promises/CHANGELOG.md | 6 + vendor/guzzlehttp/promises/composer.json | 5 - vendor/guzzlehttp/promises/src/Each.php | 2 +- vendor/guzzlehttp/promises/src/Utils.php | 2 +- vendor/guzzlehttp/psr7/CHANGELOG.md | 23 +++- vendor/guzzlehttp/psr7/README.md | 24 ++-- vendor/guzzlehttp/psr7/src/AppendStream.php | 14 +- vendor/guzzlehttp/psr7/src/BufferStream.php | 2 - vendor/guzzlehttp/psr7/src/FnStream.php | 9 +- vendor/guzzlehttp/psr7/src/Header.php | 2 +- vendor/guzzlehttp/psr7/src/HttpFactory.php | 8 +- vendor/guzzlehttp/psr7/src/InflateStream.php | 6 +- vendor/guzzlehttp/psr7/src/Message.php | 26 ++-- vendor/guzzlehttp/psr7/src/MessageTrait.php | 12 +- vendor/guzzlehttp/psr7/src/MimeType.php | 34 ++++- .../guzzlehttp/psr7/src/MultipartStream.php | 8 +- vendor/guzzlehttp/psr7/src/PumpStream.php | 6 +- vendor/guzzlehttp/psr7/src/Query.php | 4 +- vendor/guzzlehttp/psr7/src/Request.php | 6 +- vendor/guzzlehttp/psr7/src/Response.php | 1 + vendor/guzzlehttp/psr7/src/Rfc7230.php | 2 +- vendor/guzzlehttp/psr7/src/ServerRequest.php | 14 +- vendor/guzzlehttp/psr7/src/Stream.php | 11 +- .../psr7/src/StreamDecoratorTrait.php | 5 +- vendor/guzzlehttp/psr7/src/StreamWrapper.php | 60 ++++----- vendor/guzzlehttp/psr7/src/Uri.php | 51 ++++---- vendor/guzzlehttp/psr7/src/UriNormalizer.php | 10 +- vendor/guzzlehttp/psr7/src/UriResolver.php | 18 +-- vendor/guzzlehttp/psr7/src/Utils.php | 10 +- vendor/psr/http-client/CHANGELOG.md | 8 ++ vendor/psr/http-client/composer.json | 3 + .../deprecation-contracts/composer.json | 2 +- 83 files changed, 1016 insertions(+), 519 deletions(-) create mode 100644 vendor/elan-ev/opencast-api/.github/workflows/opencast-php-lib-ci.yml create mode 100644 vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcListProvidersApi.php create mode 100644 vendor/elan-ev/opencast-api/tests/Unit/OcListProvidersApiTest.php diff --git a/composer.json b/composer.json index 83ecfd2..ca310ce 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "moodle/tool_opencast", "require-dev": { - "elan-ev/opencast-api": "^1.3" + "elan-ev/opencast-api": "^1.5" } } diff --git a/composer.lock b/composer.lock index ba1d3f0..c70aa6c 100644 --- a/composer.lock +++ b/composer.lock @@ -9,16 +9,16 @@ "packages-dev": [ { "name": "elan-ev/opencast-api", - "version": "1.3.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/elan-ev/opencast-php-library.git", - "reference": "49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9" + "reference": "dfcfa0789c8a670623ed27434ced88f595941b73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elan-ev/opencast-php-library/zipball/49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9", - "reference": "49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9", + "url": "https://api.github.com/repos/elan-ev/opencast-php-library/zipball/dfcfa0789c8a670623ed27434ced88f595941b73", + "reference": "dfcfa0789c8a670623ed27434ced88f595941b73", "shasum": "" }, "require": { @@ -26,7 +26,9 @@ "php": ">=7.2.5" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.7" }, "type": "library", "extra": { @@ -60,9 +62,9 @@ ], "support": { "issues": "https://github.com/elan-ev/opencast-php-library/issues", - "source": "https://github.com/elan-ev/opencast-php-library/tree/1.3.0" + "source": "https://github.com/elan-ev/opencast-php-library/tree/1.5.0" }, - "time": "2023-05-12T14:05:26+00:00" + "time": "2023-11-13T16:47:55+00:00" }, { "name": "guzzlehttp/guzzle", @@ -194,16 +196,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.2", + "version": "1.5.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { @@ -213,11 +215,6 @@ "symfony/phpunit-bridge": "^4.4 || ^5.1" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -258,7 +255,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -274,20 +271,20 @@ "type": "tidelift" } ], - "time": "2022-08-28T14:55:35+00:00" + "time": "2023-05-21T12:31:43+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -374,7 +371,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -390,20 +387,20 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "psr/http-client", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { @@ -440,9 +437,9 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/1.0.2" + "source": "https://github.com/php-fig/http-client" }, - "time": "2023-04-10T20:12:12+00:00" + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", @@ -598,16 +595,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { @@ -616,7 +613,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -645,7 +642,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { @@ -661,7 +658,7 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2023-05-23T14:45:45+00:00" } ], "aliases": [], @@ -671,5 +668,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/vendor/autoload.php b/vendor/autoload.php index d9dcda3..7ef4359 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,24 +2,6 @@ // autoload.php @generated by Composer -if (PHP_VERSION_ID < 50600) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, $err); - } elseif (!headers_sent()) { - echo $err; - } - } - trigger_error( - $err, - E_USER_ERROR - ); -} - require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInit8ba2ca4e105ea351f7cb241590a7de7e::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index a72151c..afef3fa 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,9 +42,6 @@ */ class ClassLoader { - /** @var \Closure(string):void */ - private static $includeFile; - /** @var ?string */ private $vendorDir; @@ -109,7 +106,6 @@ class ClassLoader public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); } /** @@ -429,8 +425,7 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); + includeFile($file); return true; } @@ -560,26 +555,18 @@ private function findFileWithExtension($class, $ext) return false; } +} - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index 51e734a..d50e0c9 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -21,14 +21,12 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null */ private static $installed; @@ -39,7 +37,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -98,7 +96,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); } } @@ -119,7 +117,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints((string) $constraint); + $constraint = $parser->parseConstraints($constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -243,7 +241,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} */ public static function getRootPackage() { @@ -257,7 +255,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} */ public static function getRawData() { @@ -280,7 +278,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -303,7 +301,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data */ public static function reload($data) { @@ -313,7 +311,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -328,9 +326,7 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -342,17 +338,12 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; + self::$installed = require __DIR__ . '/installed.php'; } else { self::$installed = array(); } } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } + $installed[] = self::$installed; return $installed; } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index f27399a..62ecfd8 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,4 +1,3 @@ - Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 0fb0a2c..b26f1b1 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 4470736..a3788e4 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,12 +2,12 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', + 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index 15a2ff3..b7fc012 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index d322dae..c015a5c 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,11 +2,11 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(__DIR__); +$vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( - 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), + 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'OpencastApi\\Rest\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi/Rest'), 'OpencastApi\\Mock\\' => array($vendorDir . '/elan-ev/opencast-api/src/OpencastApi/Mock'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 3bbb734..21bebff 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,26 +23,56 @@ public static function getLoader() } spl_autoload_register(array('ComposerAutoloaderInit8ba2ca4e105ea351f7cb241590a7de7e', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); spl_autoload_unregister(array('ComposerAutoloaderInit8ba2ca4e105ea351f7cb241590a7de7e', 'loadClassLoader')); - require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e::getInitializer($loader)); + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; - $loader->register(true); + call_user_func(\Composer\Autoload\ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } - $filesToLoad = \Composer\Autoload\ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } - require $file; + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire8ba2ca4e105ea351f7cb241590a7de7e($fileIdentifier, $file); } return $loader; } } + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire8ba2ca4e105ea351f7cb241590a7de7e($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 83cc5f2..e753df9 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -8,8 +8,8 @@ class ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', + 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', ); @@ -36,8 +36,8 @@ class ComposerStaticInit8ba2ca4e105ea351f7cb241590a7de7e public static $prefixDirsPsr4 = array ( 'Psr\\Http\\Message\\' => array ( - 0 => __DIR__ . '/..' . '/psr/http-message/src', - 1 => __DIR__ . '/..' . '/psr/http-factory/src', + 0 => __DIR__ . '/..' . '/psr/http-factory/src', + 1 => __DIR__ . '/..' . '/psr/http-message/src', ), 'Psr\\Http\\Client\\' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 4e2d010..a4a1c4e 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "elan-ev/opencast-api", - "version": "1.3.0", - "version_normalized": "1.3.0.0", + "version": "1.5.0", + "version_normalized": "1.5.0.0", "source": { "type": "git", "url": "https://github.com/elan-ev/opencast-php-library.git", - "reference": "49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9" + "reference": "dfcfa0789c8a670623ed27434ced88f595941b73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elan-ev/opencast-php-library/zipball/49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9", - "reference": "49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9", + "url": "https://api.github.com/repos/elan-ev/opencast-php-library/zipball/dfcfa0789c8a670623ed27434ced88f595941b73", + "reference": "dfcfa0789c8a670623ed27434ced88f595941b73", "shasum": "" }, "require": { @@ -20,9 +20,11 @@ "php": ">=7.2.5" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.7" }, - "time": "2023-05-12T14:05:26+00:00", + "time": "2023-11-13T16:47:55+00:00", "type": "library", "extra": { "branch-alias": { @@ -56,7 +58,7 @@ ], "support": { "issues": "https://github.com/elan-ev/opencast-php-library/issues", - "source": "https://github.com/elan-ev/opencast-php-library/tree/1.3.0" + "source": "https://github.com/elan-ev/opencast-php-library/tree/1.5.0" }, "install-path": "../elan-ev/opencast-api" }, @@ -193,17 +195,17 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.2", - "version_normalized": "1.5.2.0", + "version": "1.5.3", + "version_normalized": "1.5.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "b94b2807d85443f9719887892882d0329d1e2598" + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", - "reference": "b94b2807d85443f9719887892882d0329d1e2598", + "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", "shasum": "" }, "require": { @@ -212,13 +214,8 @@ "require-dev": { "symfony/phpunit-bridge": "^4.4 || ^5.1" }, - "time": "2022-08-28T14:55:35+00:00", + "time": "2023-05-21T12:31:43+00:00", "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "installation-source": "dist", "autoload": { "files": [ @@ -260,7 +257,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.2" + "source": "https://github.com/guzzle/promises/tree/1.5.3" }, "funding": [ { @@ -280,17 +277,17 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", - "version_normalized": "2.5.0.0", + "version": "2.6.1", + "version_normalized": "2.6.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -311,7 +308,7 @@ "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2023-04-17T16:11:26+00:00", + "time": "2023-08-27T10:13:57+00:00", "type": "library", "extra": { "bamarni-bin": { @@ -379,7 +376,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.5.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -399,24 +396,24 @@ }, { "name": "psr/http-client", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "version": "1.0.3", + "version_normalized": "1.0.3.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { "php": "^7.0 || ^8.0", "psr/http-message": "^1.0 || ^2.0" }, - "time": "2023-04-10T20:12:12+00:00", + "time": "2023-09-23T14:17:50+00:00", "type": "library", "extra": { "branch-alias": { @@ -448,7 +445,7 @@ "psr-18" ], "support": { - "source": "https://github.com/php-fig/http-client/tree/1.0.2" + "source": "https://github.com/php-fig/http-client" }, "install-path": "../psr/http-client" }, @@ -615,27 +612,27 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", "shasum": "" }, "require": { "php": ">=8.1" }, - "time": "2023-03-01T10:25:55+00:00", + "time": "2023-05-23T14:45:45+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts", @@ -665,7 +662,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 45ac82c..b05cf9e 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,67 +1,67 @@ array( - 'name' => 'moodle/tool_opencast', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c9df482fe67bc694705b45edbdd61238b53a9afc', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), + 'reference' => '7255dedbafbbb1db81745bdfde8aa8aaeb9f9846', + 'name' => 'moodle/tool_opencast', 'dev' => true, ), 'versions' => array( 'elan-ev/opencast-api' => array( - 'pretty_version' => '1.3.0', - 'version' => '1.3.0.0', - 'reference' => '49a91cc3f4c8560e7c8ee7c4fd074f01b794c6f9', + 'pretty_version' => '1.5.0', + 'version' => '1.5.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../elan-ev/opencast-api', 'aliases' => array(), + 'reference' => 'dfcfa0789c8a670623ed27434ced88f595941b73', 'dev_requirement' => true, ), 'guzzlehttp/guzzle' => array( 'pretty_version' => '7.5.1', 'version' => '7.5.1.0', - 'reference' => 'b964ca597e86b752cd994f27293e9fa6b6a95ed9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), + 'reference' => 'b964ca597e86b752cd994f27293e9fa6b6a95ed9', 'dev_requirement' => true, ), 'guzzlehttp/promises' => array( - 'pretty_version' => '1.5.2', - 'version' => '1.5.2.0', - 'reference' => 'b94b2807d85443f9719887892882d0329d1e2598', + 'pretty_version' => '1.5.3', + 'version' => '1.5.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), + 'reference' => '67ab6e18aaa14d753cc148911d273f6e6cb6721e', 'dev_requirement' => true, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.5.0', - 'version' => '2.5.0.0', - 'reference' => 'b635f279edd83fc275f822a1188157ffea568ff6', + 'pretty_version' => '2.6.1', + 'version' => '2.6.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), + 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'dev_requirement' => true, ), 'moodle/tool_opencast' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'c9df482fe67bc694705b45edbdd61238b53a9afc', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), + 'reference' => '7255dedbafbbb1db81745bdfde8aa8aaeb9f9846', 'dev_requirement' => false, ), 'psr/http-client' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'reference' => '0955afe48220520692d2d09f7ab7e0f93ffd6a31', + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'dev_requirement' => true, ), 'psr/http-client-implementation' => array( @@ -73,10 +73,10 @@ 'psr/http-factory' => array( 'pretty_version' => '1.0.2', 'version' => '1.0.2.0', - 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'dev_requirement' => true, ), 'psr/http-factory-implementation' => array( @@ -88,10 +88,10 @@ 'psr/http-message' => array( 'pretty_version' => '2.0', 'version' => '2.0.0.0', - 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'dev_requirement' => true, ), 'psr/http-message-implementation' => array( @@ -103,19 +103,19 @@ 'ralouphie/getallheaders' => array( 'pretty_version' => '3.0.3', 'version' => '3.0.3.0', - 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'type' => 'library', 'install_path' => __DIR__ . '/../ralouphie/getallheaders', 'aliases' => array(), + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'dev_requirement' => true, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.2.1', - 'version' => '3.2.1.0', - 'reference' => 'e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e', + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), + 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', 'dev_requirement' => true, ), ), diff --git a/vendor/elan-ev/opencast-api/.github/workflows/opencast-php-lib-ci.yml b/vendor/elan-ev/opencast-api/.github/workflows/opencast-php-lib-ci.yml new file mode 100644 index 0000000..568a65f --- /dev/null +++ b/vendor/elan-ev/opencast-api/.github/workflows/opencast-php-lib-ci.yml @@ -0,0 +1,60 @@ +name: Opencast PHP Library CI + +on: [push, pull_request] + +jobs: + compatibility: + name: Comaptibility + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + - "8.2" + dependency-versions: + - "lowest" + - "highest" + + steps: + - name: Repo checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: none + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: ${{ matrix.dependency-versions }} + + - name: PHP Compatibility + run: composer sniffer:php${{ matrix.php-version }} + + unittest: + needs: compatibility + name: PHPUnit Test + runs-on: ubuntu-latest + steps: + - name: Repo checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + coverage: none + + - name: Install composer dependencies + uses: ramsey/composer-install@v2 + with: + dependency-versions: 8.1 + + - name: Run PHPUnit + run: vendor/bin/phpunit diff --git a/vendor/elan-ev/opencast-api/CHANGELOG.md b/vendor/elan-ev/opencast-api/CHANGELOG.md index 3dd0ea5..578b963 100644 --- a/vendor/elan-ev/opencast-api/CHANGELOG.md +++ b/vendor/elan-ev/opencast-api/CHANGELOG.md @@ -6,7 +6,7 @@ - Error Handling (Version control) [#3](https://github.com/elan-ev/opencast-php-library/issues/3) - Add dynamic role headers with "X-RUN-WITH-ROLES" to requests [#2](https://github.com/elan-ev/opencast-php-library/issues/2) - A single filter can occur multiple times [#1](https://github.com/elan-ev/opencast-php-library/issues/1) - + # 1.1.1 - Sysinfo Endpoint [#9](https://github.com/elan-ev/opencast-php-library/issues/9) - Optional serviceType in getServiceJSON [#10](https://github.com/elan-ev/opencast-php-library/issues/10) @@ -27,4 +27,12 @@ - Add the series fulltext search query into Series API in: OcSeriesApi->getAllFullTextSearch() - The ingest API now allows setting tags when ingesting attachments or catalogs via URL, therefore OcIngest methods including addCatalog, addCatalogUrl, addAttachment and addAttachmentUrl now accept an array parameter containing the tags. - Dynamic ingest endpoint loading into Opencast class. -- Upgrade guzzlehttp/guzzle to 7.5.1 \ No newline at end of file +- Upgrade guzzlehttp/guzzle to 7.5.1 + +# 1.4.0 +- Introducing runAsUser method to add X-RUN-AS-USER into the request headers. +- Introducing OcListProvidersApi REST API service endpoint. +- Add another array param into response result of the library called 'origin', which contains the information about oriniated request like its path, base url, params and method. + +# 1.5.0 +- PHP 8.2 compatibility: prevent dynamic property declarations diff --git a/vendor/elan-ev/opencast-api/README.md b/vendor/elan-ev/opencast-api/README.md index d8f4262..d1deca1 100644 --- a/vendor/elan-ev/opencast-api/README.md +++ b/vendor/elan-ev/opencast-api/README.md @@ -25,7 +25,7 @@ $config = [ 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0, // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null, // The API Version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ]; $engageConfig = [ @@ -35,14 +35,14 @@ $engageConfig = [ 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0, // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null, // The API version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ]; use OpencastApi\Opencast; // In case of a distributed Opencast setup $opencastDualApi = new Opencast($config, $engageConfig); -// Or simply +// Or simply $opencastApi = new Opencast($config); // Accessing Event Endpoints to get all events @@ -72,7 +72,7 @@ $config = [ 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0, // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null, // The API version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ]; @@ -111,7 +111,7 @@ $config = [ 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0, // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null, // The API version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ]; ``` NOTE: the configuration for presentation (`engage` node) responsible for search has to follow the same definition as normal config. But in case any parameter is missing, the value will be taken from the main config param. @@ -128,12 +128,25 @@ $opencastApiWithoutIngest = new Opencast($config, $engageConfig, false); # Response The return result of each call is an `Array` containing the following information: +From v1.4 the 5th response parameter 'origin' is available! ```php [ - 'code' => 200, // The status code of the response - 'body' => '', // The result of the response. It can be type of string, array or object ('' || [] || {}) - 'reason' => 'OK', // The reason/message of response - 'location' => '', // The location header of the response when available + 'code' => 200, // The status code of the response + 'body' => '', // The result of the response. It can be type of string, array or objec ('' || [] || {}) + 'reason' => 'OK', // The reason/message of response + 'location' => '', // The location header of the response when available, + 'origin' => [ // The information about the origin of the request (ADDED in v1.4) + 'base' => 'https://example.com', // Request base url address + 'path' => '/api/path', // Request url path + 'method' => 'GET', // Request method + 'params' => [ // Request parameters + 'query_params' => [], + 'form_params' => [], + 'form_multipart_params' => [], + 'json' => [], + 'body' => null, + ] + ] ] ``` # Filters and Sorts @@ -187,6 +200,26 @@ $seriesResponse = $ocSeriesApi->runWithRoles($roles)->getAll(['onlyWithWriteAcce ``` NOTE: Roles can be either an `Array` including each role, or a comma separated string! +# `runAsUser($user)` +Sometimes it is needed to perform the request with a disposable header of `X-RUN-AS-USER` containing the user id in order for Opencast to assume that this user has access right. This feature is added since v1.4. +NOTE: This method accepts an `String` defining the user id to check against! +```php +// With Opencast generic class +use OpencastApi\Opencast; +$opencastApi = new Opencast($config); + +// Role +$user = 'lms-admin'; +$seriesResponse = $opencastApi->seriesApi->runAsUser($user)->getAll(['onlyWithWriteAccess' => true]); + +// Or direct class call +$opencastClient = \OpencastApi\Rest\OcRestClient($config); +$ocSeriesApi = \OpencastApi\Rest\OcSeriesApi($opencastClient); +// Role +$user = 'lms-admin'; +$seriesResponse = $ocSeriesApi->runAsUser($user)->getAll(['onlyWithWriteAccess' => true]); +``` + # `noHeader()` In order to perform a request call to an endpoint without any request headers/options, you can use this method before calling the desired function in an endpoint class: NOTE: This method accepts nothing (`void`).
@@ -238,7 +271,7 @@ $baseResponse = $ocBaseApi->setRequestConnectionTimeout(10)->get(); # Available Opencast REST Service Endpoint - `/api/*`: all known API endpoints of Opencast are available to be used in this library. [API Endpoints definitions WiKi](https://github.com/elan-ev/opencast-php-library/wiki/API-Endpoints) - + - `/ingest/*`: all known Ingest endpoints are available. [Ingest Endpoint definitions WiKi](https://github.com/elan-ev/opencast-php-library/wiki/OcIngest) - `/services/services.json`: only services.json is available. [Services Endpoint definitions WiKi](https://github.com/elan-ev/opencast-php-library/wiki/OcServices) @@ -346,7 +379,7 @@ $opencast = new \OpencastApi\Opencast($config); ``` # Naming convention -## Classes: +## Classes: Apart from 'Opencast' class, all other classes under `OpencastApi\Rest\` namespace start with `Oc` followed by the name and the endpoint category. For example: - `OcEventsApi` contains 3 parts including Oc + Endpoint Name (Events) + Endpoint Category (Api) - `OcServices` contains 2 parts including Oc + Endpoint Name/Category (Services) @@ -359,7 +392,7 @@ $config = [/*the config*/]; $opencast = new Opencast($config); // Accessing OcEventsApi would be like: (without Oc and in camelCase format) -$ocEventsApi = $opencast->eventsApi; +$ocEventsApi = $opencast->eventsApi; ``` # References - Main Opencast REST Service Documentation diff --git a/vendor/elan-ev/opencast-api/composer.json b/vendor/elan-ev/opencast-api/composer.json index 396f4ce..80bd09b 100644 --- a/vendor/elan-ev/opencast-api/composer.json +++ b/vendor/elan-ev/opencast-api/composer.json @@ -28,8 +28,16 @@ "OpencastApi\\Mock\\": "src/OpencastApi/Mock/" } }, + "scripts": { + "sniffer:php7.4": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 7.4", + "sniffer:php8.0": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.0", + "sniffer:php8.1": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.1", + "sniffer:php8.2": "phpcs -p -v ./src --standard=vendor/phpcompatibility/php-compatibility/PHPCompatibility --runtime-set testVersion 8.2" + }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5", + "squizlabs/php_codesniffer": "^3.7", + "phpcompatibility/php-compatibility": "^9.3" }, "autoload-dev": { "psr-4": { diff --git a/vendor/elan-ev/opencast-api/composer.lock b/vendor/elan-ev/opencast-api/composer.lock index 76d9dcb..9d9b39d 100644 --- a/vendor/elan-ev/opencast-api/composer.lock +++ b/vendor/elan-ev/opencast-api/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c3c5014ba29456c0398eb1c1c90d920", + "content-hash": "0d3c9b3d077067ccb9d58228ab0b43fe", "packages": [ { "name": "guzzlehttp/guzzle", @@ -903,6 +903,68 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpcompatibility/php-compatibility", + "version": "9.3.5", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.26", @@ -2288,6 +2350,63 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.2", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2023-02-22T23:07:41+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.1", diff --git a/vendor/elan-ev/opencast-api/src/OpencastApi/Opencast.php b/vendor/elan-ev/opencast-api/src/OpencastApi/Opencast.php index 8f3f48f..24fb06a 100644 --- a/vendor/elan-ev/opencast-api/src/OpencastApi/Opencast.php +++ b/vendor/elan-ev/opencast-api/src/OpencastApi/Opencast.php @@ -1,4 +1,4 @@ - 'https://develop.opencast.org/', // The API url of the opencast instance (required) @@ -20,7 +77,7 @@ class Opencast 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0 // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null // The API Version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ] $engageConfig = [ @@ -30,7 +87,7 @@ class Opencast 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0 // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null // The API Version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ] */ /** @@ -49,13 +106,13 @@ public function __construct($config, $engageConfig = [], $enableingest = true) private function setEndpointProperties($config, $enableingest) { foreach(glob(__DIR__ . '/Rest/*.php') as $classPath) { - + $className = basename($classPath, '.php'); $fullClassName = "\\OpencastApi\\Rest\\{$className}"; $propertyName = lcfirst(str_replace('Oc', '', $className)); $client = $this->restClient; - if (in_array($className, $this->excludeFilters()) || property_exists($this, $propertyName)) { + if (in_array($className, $this->excludeFilters())) { continue; } @@ -63,7 +120,10 @@ private function setEndpointProperties($config, $enableingest) $client = $this->engageRestClient; } - $this->{$propertyName} = new $fullClassName($client); + // Make sure the property is declared properly! + if (property_exists($this, $propertyName)) { + $this->{$propertyName} = new $fullClassName($client); + } } if ($enableingest) { @@ -133,7 +193,10 @@ private function setIngestProperty($config) $ingestClient = new OcRestClient($config); } - $this->ingest = new OcIngest($ingestClient); + // Make sure ingest property exists! + if (property_exists($this, 'ingest')) { + $this->ingest = new OcIngest($ingestClient); + } } } @@ -142,4 +205,4 @@ public function __debugInfo() return []; } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcListProvidersApi.php b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcListProvidersApi.php new file mode 100644 index 0000000..fdf8090 --- /dev/null +++ b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcListProvidersApi.php @@ -0,0 +1,50 @@ + 200, 'body' => '{The listproviders are returned as a list.}'] + */ + public function getProviders() + { + if (!$this->restClient->hasVersion('1.10.0')) { + return [ + 'code' => 403, + 'reason' => 'API Version (>= 1.10.0) is required' + ]; + } + $uri = self::URI . "/providers.json"; + return $this->restClient->performGet($uri); + } + + /** + * Provides key-value list from the given listprovider. + * + * @param string $source The provide source name. + * + * @return array the response result ['code' => 200, 'body' => '{The key-value list are returned as a JSON object.}'] + */ + public function getList($source) + { + if (!$this->restClient->hasVersion('1.10.0')) { + return [ + 'code' => 403, + 'reason' => 'API Version (>= 1.10.0) is required' + ]; + } + $uri = self::URI . "/{$source}.json"; + return $this->restClient->performGet($uri); + } +} +?> diff --git a/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRest.php b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRest.php index 1abf313..3fbcd18 100644 --- a/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRest.php +++ b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRest.php @@ -11,9 +11,9 @@ public function __construct($restClient) /** * Converts the array of sorting into comma-separated list of sort criteria "Sort:Attr" - * + * * @param array $sort the array of sorting params - * + * * @return string consumable sorting string */ protected function convertArrayToSorting($sort) { @@ -24,9 +24,9 @@ protected function convertArrayToSorting($sort) { /** * Converts the array of filtering into comma-separated list of filter criteria "Filter:value" - * + * * @param array $filters the array of filters - * + * * @return string consumable filtering string */ protected function convertArrayToFiltering($filters) { @@ -61,6 +61,22 @@ public function runWithRoles($roles = []) return $this; } + /** + * To perform the request with disposable X-RUN-AS-USER header. + * + * @param string $user the user to run the request with + * + * @return object $this the class object where the call is requested from. + */ + public function runAsUser($user) + { + $user = trim($user); + if (!empty($user)) { + $this->restClient->registerAdditionalHeader('X-RUN-AS-USER', $user); + } + return $this; + } + /** * To perform the request without header. * @@ -98,4 +114,4 @@ public function setRequestConnectionTimeout($connectionTimeout = 0) return $this; } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRestClient.php b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRestClient.php index a89430a..f871cff 100644 --- a/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRestClient.php +++ b/vendor/elan-ev/opencast-api/src/OpencastApi/Rest/OcRestClient.php @@ -16,7 +16,8 @@ class OcRestClient extends Client private $headerExceptions = []; private $additionalHeaders = []; private $noHeader = false; - /* + private $origin; + /* $config = [ 'url' => 'https://develop.opencast.org/', // The API url of the opencast instance (required) 'username' => 'admin', // The API username. (required) @@ -24,7 +25,7 @@ class OcRestClient extends Client 'timeout' => 0, // The API timeout. In seconds (default 0 to wait indefinitely). (optional) 'connect_timeout' => 0, // The API connection timeout. In seconds (default 0 to wait indefinitely) (optional) 'version' => null // The API Version. (Default null). (optional) - 'handler' => null // The Mock Response Handler with Closure type. (Default null). (optional) + 'handler' => null // The callable Handler or HandlerStack. (Default null). (optional) ] */ public function __construct($config) @@ -194,11 +195,15 @@ private function returnResult($response) $location = $response->getHeader('Location'); } $result['location'] = $location; + + $result['origin'] = !empty($this->origin) ? $this->origin : null; + return $result; } public function performGet($uri, $options = []) { + $this->prepareOrigin($uri, $options, 'GET'); try { $response = $this->get($uri, $this->addRequestOptions($uri, $options)); return $this->returnResult($response); @@ -209,6 +214,7 @@ public function performGet($uri, $options = []) public function performPost($uri, $options = []) { + $this->prepareOrigin($uri, $options, 'POST'); try { $response = $this->post($uri, $this->addRequestOptions($uri, $options)); return $this->returnResult($response); @@ -220,6 +226,7 @@ public function performPost($uri, $options = []) public function performPut($uri, $options = []) { + $this->prepareOrigin($uri, $options, 'PUT'); try { $response = $this->put($uri, $this->addRequestOptions($uri, $options)); return $this->returnResult($response); @@ -230,6 +237,7 @@ public function performPut($uri, $options = []) public function performDelete($uri, $options = []) { + $this->prepareOrigin($uri, $options, 'DELETE'); try { $response = $this->delete($uri, $this->addRequestOptions($uri, $options)); return $this->returnResult($response); @@ -245,6 +253,7 @@ private function resolveException(\Throwable $th) $error['reason'] = $th->getMessage(); $error['body'] = ''; $error['location'] = ''; + $error['origin'] = !empty($this->origin) ? $this->origin : null; if (!empty($error['reason'])) { return $error; } @@ -306,5 +315,21 @@ public function getQueryParams($params) } return $options; } + + private function prepareOrigin($uri, $options, $method) + { + $this->origin = [ + 'base' => $this->baseUri, + 'path' => $uri, + 'method' => $method, + 'params' => [ + 'query_params' => isset($options['query']) ? $options['query'] : [], + 'form_params' => isset($options['form_params']) ? $options['form_params'] : [], + 'form_multipart_params' => isset($options['multipart']) ? $options['multipart'] : [], + 'json' => isset($options['json']) ? $options['json'] : [], + 'body' => isset($options['body']) ? $options['body'] : null, + ] + ]; + } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/DataProvider/EventsDataProvider.php b/vendor/elan-ev/opencast-api/tests/DataProvider/EventsDataProvider.php index 661d226..fa94f05 100644 --- a/vendor/elan-ev/opencast-api/tests/DataProvider/EventsDataProvider.php +++ b/vendor/elan-ev/opencast-api/tests/DataProvider/EventsDataProvider.php @@ -1,9 +1,9 @@ - \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/DataProvider/SetupDataProvider.php b/vendor/elan-ev/opencast-api/tests/DataProvider/SetupDataProvider.php index affe1d1..80feb3c 100644 --- a/vendor/elan-ev/opencast-api/tests/DataProvider/SetupDataProvider.php +++ b/vendor/elan-ev/opencast-api/tests/DataProvider/SetupDataProvider.php @@ -1,15 +1,15 @@ - $url, 'username' => $username, @@ -37,4 +37,4 @@ public static function getMockResponses($fileName): array return $mockResponse !== false ? $mockResponse : []; } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcAgentsApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcAgentsApiTest.php index 9f33f47..d7ee9e0 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcAgentsApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcAgentsApiTest.php @@ -1,4 +1,4 @@ -ocAgentsApi = $ocRestApi->agentsApi; } @@ -34,4 +34,4 @@ public function get_agents(): void } } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcBaseApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcBaseApiTest.php index 31b0e9e..7fadc0e 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcBaseApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcBaseApiTest.php @@ -1,4 +1,4 @@ -ocBaseApi = $ocRestApi->baseApi; } @@ -109,4 +109,4 @@ public function get_default_version(): void $this->assertSame(200, $response['code'], 'Failure to get base info'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcEventsApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcEventsApiTest.php index d676dcb..0ecb222 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcEventsApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcEventsApiTest.php @@ -1,4 +1,4 @@ -ocEventsApi = $ocRestApi->eventsApi; } @@ -23,7 +23,7 @@ protected function setUp(): void public function get_all_events($params): void { $response = $this->ocEventsApi->getAll($params); - + $this->assertSame(200, $response['code'], 'Failure to get event list'); } @@ -54,7 +54,7 @@ public function empty_random_event_id(): string */ public function get_single_event(string $identifier): string { - $responseAll = $this->ocEventsApi->getAll(['withacl' => true]); + $responseAll = $this->ocEventsApi->getAll(['withacl' => true]); $this->assertSame(200, $responseAll['code'], 'Failure to get event list'); $events = $responseAll['body']; if (!empty($events)) { @@ -89,18 +89,19 @@ public function empty_created_id(): string public function create_and_update_event(string $createdEventIdentifier): string { $responseCreate = $this->ocEventsApi->create( - \Tests\DataProvider\EventsDataProvider::getAcls(), - \Tests\DataProvider\EventsDataProvider::getMetadata('presenter'), - \Tests\DataProvider\EventsDataProvider::getProcessing(), + \Tests\DataProvider\EventsDataProvider::getAcls(), + \Tests\DataProvider\EventsDataProvider::getMetadata('presenter'), + \Tests\DataProvider\EventsDataProvider::getProcessing(), '', - \Tests\DataProvider\EventsDataProvider::getPresenterFile(), - \Tests\DataProvider\EventsDataProvider::getPresentationFile(), + \Tests\DataProvider\EventsDataProvider::getPresenterFile(), + \Tests\DataProvider\EventsDataProvider::getPresentationFile(), \Tests\DataProvider\EventsDataProvider::getAudioFile(), array($this, 'progressCallback') ); $this->assertContains($responseCreate['code'], [200, 201], 'Failure to create an event'); $createdEventIdentifier = $responseCreate['body']->identifier; $this->assertNotEmpty($createdEventIdentifier); + sleep(5); $metadata = str_replace( '{update_replace}', @@ -109,7 +110,7 @@ public function create_and_update_event(string $createdEventIdentifier): string ); $responseUpdate = $this->ocEventsApi->update($createdEventIdentifier, '', $metadata); $this->assertSame(204, $responseUpdate['code'], 'Failure to update an event'); - + return $createdEventIdentifier; } @@ -174,6 +175,16 @@ public function get_update_delete_acls(string $identifier): string $this->assertSame(200, $response1['code'], 'Failure to get ACLs of an event'); $acls = $response1['body']; + if (empty($acls)) { + $response1_1 = $this->ocEventsApi->addSingleAcl($identifier, 'write', 'ROLE_PHPUNIT_TESTING_USER_0'); + $this->assertSame(204, $response1_1['code'], 'Failure to set single ACL for an event'); + + $response1_2 = $this->ocEventsApi->getAcl($identifier); + $this->assertSame(200, $response1_2['code'], 'Failure to get ACLs of an event'); + + $acls = $response1_2['body']; + } + $this->assertNotEmpty($acls); // Delete all acls. @@ -280,4 +291,4 @@ public function get_update_scheduling(string $identifier): void } } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcGroupsApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcGroupsApiTest.php index c7b74e0..050c14e 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcGroupsApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcGroupsApiTest.php @@ -1,4 +1,4 @@ -ocGroupsApi = $ocRestApi->groupsApi; } @@ -43,22 +43,25 @@ public function empty_created_id(): string */ public function create_get_update_delete_group(string $identifier): string { - $name = 'PHPUNIT_TESTING_GROUP'; - // Create - $response1 = $this->ocGroupsApi->create($name); - $this->assertSame(201, $response1['code'], 'Failure to create a group'); - + $name = 'PHPUNIT_TESTING_GROUP_' . uniqid(); // Get the group. - $response3 = $this->ocGroupsApi->get(strtolower($name)); - // $response3 = $this->ocGroupsApi->get('phpunit_testing_group'); - $this->assertSame(200, $response3['code'], 'Failure to get group'); - $group = $response3['body']; + $response0 = $this->ocGroupsApi->get(strtolower($name)); + if ($response0['code'] == 404) { + // Create + $response1 = $this->ocGroupsApi->create($name); + $this->assertSame(201, $response1['code'], 'Failure to create a group'); + } + + // Get the group again! + $response2 = $this->ocGroupsApi->get(strtolower($name)); + $this->assertSame(200, $response2['code'], 'Failure to get group'); + $group = $response2['body']; $this->assertNotEmpty($group); $identifier = $group->identifier; - + // Update the group - $response4 = $this->ocGroupsApi->update($group->identifier, $name, 'THIS IS AN UPDATED DESC FROM PHPUNIT'); - $this->assertSame(200, $response4['code'], 'Failure to update group'); + $response3 = $this->ocGroupsApi->update($group->identifier, $name, 'THIS IS AN UPDATED DESC FROM PHPUNIT'); + $this->assertSame(200, $response3['code'], 'Failure to update group'); $this->assertNotEmpty($identifier); return $identifier; @@ -93,4 +96,4 @@ public function delete_group(string $identifier): void $this->assertContains($response['code'], [200, 204], 'Failure to delete group'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcIngestTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcIngestTest.php index 7c66e83..e02a9e8 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcIngestTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcIngestTest.php @@ -1,4 +1,4 @@ -ocIngest = $ocRestApi->ingest; } @@ -39,7 +39,7 @@ public function get_mediapackage_create_series(array $ingestData): array $mediaPackage = $responseCreateMediaPackage['body']; $this->assertNotEmpty($mediaPackage); $ingestData['mediaPackage'] = $mediaPackage; - + $this->assertNotEmpty($ingestData); return $ingestData; } @@ -192,7 +192,7 @@ public function add_attachment_all(array $ingestData): array $mediaPackage = $responseAddAttachmentUrl['body']; $this->assertNotEmpty($mediaPackage); } - + $ingestData['mediaPackage'] = $mediaPackage; $this->assertNotEmpty($ingestData); @@ -213,4 +213,4 @@ public function ingest(array $ingestData): void $ingestData['mediaPackage'] = $mediaPackage; } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcListProvidersApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcListProvidersApiTest.php new file mode 100644 index 0000000..551ee62 --- /dev/null +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcListProvidersApiTest.php @@ -0,0 +1,38 @@ +ocListProvidersApi = $ocRestApi->listProvidersApi; + } + + /** + * @test + */ + public function get_providers_and_provider_list(): void + { + $response = $this->ocListProvidersApi->getProviders(); + $this->assertSame(200, $response['code'], 'failure to get providers list'); + $providers = $response['body']; + if (!empty($providers) && is_array($providers)) { + $providers = count($providers) == 1 ? reset($providers) : $providers; + $provider = $providers[array_rand($providers)]; + $responseList = $this->ocListProvidersApi->getList($provider); + $this->assertSame(200, $responseList['code'], 'failure to get provider list'); + } else { + $this->markTestIncomplete('No provider to complete the test!'); + } + } +} +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcSearchTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcSearchTest.php index b447a5a..db87859 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcSearchTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcSearchTest.php @@ -1,4 +1,4 @@ -ocSearch = $ocRestApi->search; } @@ -46,4 +46,4 @@ public function get_series($params, $format): void $this->assertSame(200, $response['code'], 'Failure to search series'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcSecurityApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcSecurityApiTest.php index 92d47ff..8ca54e3 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcSecurityApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcSecurityApiTest.php @@ -1,4 +1,4 @@ -ocSecurityApi = $ocRestApi->securityApi; } @@ -27,4 +27,4 @@ public function sign(): void $this->assertSame(200, $response['code'], 'Failure to sign in security api'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcSeriesApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcSeriesApiTest.php index 672c072..970e096 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcSeriesApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcSeriesApiTest.php @@ -1,4 +1,4 @@ -ocSeriesApi = $ocRestApi->seriesApi; } @@ -56,6 +56,20 @@ public function get_all_series_with_roles(): void $this->assertSame(200, $response['code'], 'Failure to get series list'); } + /** + * @test + */ + public function get_all_series_with_user(): void + { + $params = [ + 'onlyWithWriteAccess' => true + ]; + $user = ' admin '; + $response = $this->ocSeriesApi->runAsUser($user)->getAll($params); + + $this->assertSame(200, $response['code'], 'Failure to get series list'); + } + /** * @test */ @@ -102,7 +116,7 @@ public function get_update_delete_series_metadata(string $identifier): string $this->assertSame(200, $response1['code'], 'Failure to get series metadata'); $metadataAll = $response1['body']; $this->assertNotEmpty($metadataAll); - + // Update all metadata. $metadata = str_replace( '{update_replace}', @@ -204,4 +218,4 @@ public function delete_series(string $identifier): void $this->assertSame(204, $response['code'], 'Failure to delete a series'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcServicesTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcServicesTest.php index a84d1cb..eb0a3aa 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcServicesTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcServicesTest.php @@ -1,4 +1,4 @@ -ocServices = $ocRestApi->services; } @@ -36,4 +36,4 @@ public function get_all_services(): void $this->assertSame(200, $response['code'], 'Failure to get services list'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcStatisticsApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcStatisticsApiTest.php index 16c7d03..9173355 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcStatisticsApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcStatisticsApiTest.php @@ -1,4 +1,4 @@ -ocStatisticsApi = $ocRestApi->statisticsApi; } @@ -64,4 +64,4 @@ public function get_statistical_data_cvs($data, $filter, $limit, $offset): void $this->assertContains($response['code'], [200, 404], 'Failure to get statistical data cvs'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcSysinfoTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcSysinfoTest.php index abce572..6c85699 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcSysinfoTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcSysinfoTest.php @@ -1,4 +1,4 @@ -ocSysinfo = $ocRestApi->sysinfo; } @@ -28,4 +28,4 @@ public function get_version(): void $this->assertSame(200, $responseOpencast['code'], 'Failure to get version bundle with opencast prefix'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowTest.php index 407a1d9..796002e 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowTest.php @@ -1,4 +1,4 @@ -ocWorkflow = $ocRestApi->workflow; } @@ -126,4 +126,4 @@ public function setters_test(): void } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowsApiTest.php b/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowsApiTest.php index e5c5640..6618f4b 100644 --- a/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowsApiTest.php +++ b/vendor/elan-ev/opencast-api/tests/Unit/OcWorkflowsApiTest.php @@ -1,4 +1,4 @@ -ocWorkflowsApi = $ocRestApi->workflowsApi; $this->ocEventsApi = $ocRestApi->eventsApi; } @@ -37,10 +37,21 @@ public function get_definition_run_update_delete_workflow(): void { $data = []; // Get event - $response0 = $this->ocEventsApi->getAll(); + $response0 = $this->ocEventsApi->getAll( + ['withpublications' => true] + ); $this->assertSame(200, $response0['code'], 'Failure to get events for the workflows!'); $events = $response0['body']; - $event = $events[array_rand($events)]; + $event = null; + foreach ($events as $ev) { + if ($ev->status === "EVENTS.EVENTS.STATUS.PROCESSED") { + $event = $ev; + break; + } + } + if (empty($event)) { + $this->markTestSkipped('No proper event found to apply workflow!'); + } $this->assertNotEmpty($event); $data['event_identifier'] = $event->identifier; @@ -61,7 +72,7 @@ public function get_definition_run_update_delete_workflow(): void $this->assertNotEmpty($definition); $data['workflow_definition_identifier'] = $definition->identifier; - + // Create (run) Workflow. $response3 = $this->ocWorkflowsApi->run( $data['event_identifier'], @@ -70,18 +81,22 @@ public function get_definition_run_update_delete_workflow(): void $this->assertSame(201, $response3['code'], 'Failure to create (run) a workflow'); $workflowId = $response3['body']; $this->assertNotEmpty($workflowId); + sleep(1); // Get the workflow. $response4 = $this->ocWorkflowsApi->get($workflowId->identifier, true, true); $this->assertSame(200, $response4['code'], 'Failure to get a workflow'); + sleep(1); // Update workflow. $response5 = $this->ocWorkflowsApi->update($workflowId->identifier, 'stopped'); $this->assertSame(200, $response5['code'], 'Failure to update a workflow'); + sleep(1); // Delete the workflow. $response6 = $this->ocWorkflowsApi->delete($workflowId->identifier); $this->assertSame(204, $response6['code'], 'Failure to delete a workflow'); + sleep(1); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcAgentsApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcAgentsApiTestMock.php index 2f07811..368e332 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcAgentsApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcAgentsApiTestMock.php @@ -1,4 +1,4 @@ -ocAgentsApi = $ocRestApi->agentsApi; } @@ -43,4 +43,4 @@ public function get_agents(): void } } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcBaseApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcBaseApiTestMock.php index 99380f5..f68b712 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcBaseApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcBaseApiTestMock.php @@ -1,4 +1,4 @@ -ocBaseApi = $ocRestApi->baseApi; } @@ -118,4 +118,4 @@ public function get_default_version(): void $this->assertSame(200, $response['code'], 'Failure to get base info'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcEventsApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcEventsApiTestMock.php index fa93944..3013421 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcEventsApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcEventsApiTestMock.php @@ -1,4 +1,4 @@ -ocEventsApi = $ocRestApi->eventsApi; } @@ -94,12 +94,12 @@ public function empty_created_id(): string public function create_and_update_event(string $createdEventIdentifier): string { $responseCreate = $this->ocEventsApi->create( - \Tests\DataProvider\EventsDataProvider::getAcls(), - \Tests\DataProvider\EventsDataProvider::getMetadata('presenter'), - \Tests\DataProvider\EventsDataProvider::getProcessing(), + \Tests\DataProvider\EventsDataProvider::getAcls(), + \Tests\DataProvider\EventsDataProvider::getMetadata('presenter'), + \Tests\DataProvider\EventsDataProvider::getProcessing(), '', - \Tests\DataProvider\EventsDataProvider::getPresenterFile(), - \Tests\DataProvider\EventsDataProvider::getPresentationFile(), + \Tests\DataProvider\EventsDataProvider::getPresenterFile(), + \Tests\DataProvider\EventsDataProvider::getPresentationFile(), \Tests\DataProvider\EventsDataProvider::getAudioFile(), array($this, 'progressCallback') ); @@ -114,7 +114,7 @@ public function create_and_update_event(string $createdEventIdentifier): string ); $responseUpdate = $this->ocEventsApi->update($createdEventIdentifier, '', $metadata); $this->assertSame(204, $responseUpdate['code'], 'Failure to update an event'); - + return $createdEventIdentifier; } @@ -259,4 +259,4 @@ public function get_update_scheduling(string $identifier): void } } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcGroupsApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcGroupsApiTestMock.php index 8b67fa5..b4eef3b 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcGroupsApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcGroupsApiTestMock.php @@ -1,4 +1,4 @@ -ocGroupsApi = $ocRestApi->groupsApi; } @@ -61,7 +61,7 @@ public function create_get_update_delete_group(string $identifier): string $group = $response3['body']; $this->assertNotEmpty($group); $identifier = $group->identifier; - + // Update the group $response4 = $this->ocGroupsApi->update($group->identifier, $name, 'THIS IS AN UPDATED DESC FROM PHPUNIT'); $this->assertSame(200, $response4['code'], 'Failure to update group'); @@ -99,4 +99,4 @@ public function delete_group(string $identifier): void $this->assertContains($response['code'], [200, 204], 'Failure to delete group'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcIngestTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcIngestTestMock.php index 53641fe..abdece4 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcIngestTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcIngestTestMock.php @@ -1,4 +1,4 @@ -ocIngest = $ocRestApi->ingest; } @@ -46,7 +46,7 @@ public function get_mediapackage_create_series(array $ingestData): array $mediaPackage = $responseCreateMediaPackage['body']; $this->assertNotEmpty($mediaPackage); $ingestData['mediaPackage'] = $mediaPackage; - + $this->assertNotEmpty($ingestData); return $ingestData; } @@ -59,7 +59,7 @@ public function get_mediapackage_create_series(array $ingestData): array public function add_catalog_all(array $ingestData): array { $flavor = 'dublincore/episode'; - + // Add Catalog with file if ($episodeXmlFile = \Tests\DataProvider\IngestDataProvider::getEpisodeXMLFile()) { $responseAddCatalogFile = $this->ocIngest->addCatalog($ingestData['mediaPackage'], $flavor, $episodeXmlFile); @@ -197,7 +197,7 @@ public function add_attachment_all(array $ingestData): array $mediaPackage = $responseAddAttachmentUrl['body']; $this->assertNotEmpty($mediaPackage); } - + $ingestData['mediaPackage'] = $mediaPackage; $this->assertNotEmpty($ingestData); @@ -218,4 +218,4 @@ public function ingest(array $ingestData): void $ingestData['mediaPackage'] = $mediaPackage; } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSearchTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSearchTestMock.php index 491f518..0214f4f 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSearchTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSearchTestMock.php @@ -1,4 +1,4 @@ -ocSearch = $ocRestApi->search; } @@ -53,4 +53,4 @@ public function get_series(): void $this->assertSame(200, $response['code'], 'Failure to search series'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSecurityApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSecurityApiTestMock.php index 2decd39..c71f53d 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSecurityApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSecurityApiTestMock.php @@ -1,4 +1,4 @@ -ocSecurityApi = $ocRestApi->securityApi; } @@ -34,4 +34,4 @@ public function sign(): void $this->assertSame(200, $response['code'], 'Failure to sign in security api'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSeriesApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSeriesApiTestMock.php index d024d50..ec7dc0d 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSeriesApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSeriesApiTestMock.php @@ -1,4 +1,4 @@ -ocSeriesApi = $ocRestApi->seriesApi; } @@ -91,7 +91,7 @@ public function get_update_delete_series_metadata(string $identifier): string $this->assertSame(200, $response1['code'], 'Failure to get series metadata'); $metadataAll = $response1['body']; $this->assertNotEmpty($metadataAll); - + // Update all metadata. $metadata = str_replace( '{update_replace}', @@ -117,7 +117,7 @@ public function get_update_delete_series_metadata(string $identifier): string $response4 = $this->ocSeriesApi->updateMetadata($identifier, $dcMetadata, $type); $this->assertSame(200, $response4['code'], 'Failure to update series metadata'); - + // Delete metadata. $response5 = $this->ocSeriesApi->deleteMetadata($identifier, $type); $this->assertSame(403, $response5['code'], 'Failure to delete type metadata of a series'); @@ -193,4 +193,4 @@ public function delete_series(string $identifier): void $this->assertSame(204, $response['code'], 'Failure to delete a series'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcServicesTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcServicesTestMock.php index 472e974..ada475a 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcServicesTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcServicesTestMock.php @@ -1,4 +1,4 @@ -ocServices = $ocRestApi->services; } @@ -43,4 +43,4 @@ public function get_all_services(): void $this->assertSame(200, $response['code'], 'Failure to get services list'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcStatisticsApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcStatisticsApiTestMock.php index f560bd7..9305a68 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcStatisticsApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcStatisticsApiTestMock.php @@ -1,4 +1,4 @@ -ocStatisticsApi = $ocRestApi->statisticsApi; } @@ -42,4 +42,4 @@ public function get_provider(): void $this->assertContains($response['code'], [200, 404], 'Failure to get provider'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSysinfoTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSysinfoTestMock.php index ebf1461..0d1f618 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcSysinfoTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcSysinfoTestMock.php @@ -1,4 +1,4 @@ -ocSysinfo = $ocRestApi->sysinfo; } @@ -35,4 +35,4 @@ public function get_version(): void $this->assertSame(200, $responseOpencast['code'], 'Failure to get version bundle with opencast prefix'); } } -?> \ No newline at end of file +?> diff --git a/vendor/elan-ev/opencast-api/tests/UnitMock/OcWorkflowsApiTestMock.php b/vendor/elan-ev/opencast-api/tests/UnitMock/OcWorkflowsApiTestMock.php index 46f9981..5e567c3 100644 --- a/vendor/elan-ev/opencast-api/tests/UnitMock/OcWorkflowsApiTestMock.php +++ b/vendor/elan-ev/opencast-api/tests/UnitMock/OcWorkflowsApiTestMock.php @@ -1,4 +1,4 @@ -ocWorkflowsApi = $ocRestApi->workflowsApi; $this->ocEventsApi = $ocRestApi->eventsApi; } @@ -55,7 +55,7 @@ public function get_definition_run_update_delete_workflow(): void $this->assertNotEmpty($definition); $data['workflow_definition_identifier'] = $definition->identifier; - + // Create (run) Workflow. $response3 = $this->ocWorkflowsApi->run( $data['event_identifier'], @@ -78,4 +78,4 @@ public function get_definition_run_update_delete_workflow(): void $this->assertSame(204, $response6['code'], 'Failure to delete a workflow'); } } -?> \ No newline at end of file +?> diff --git a/vendor/guzzlehttp/promises/CHANGELOG.md b/vendor/guzzlehttp/promises/CHANGELOG.md index 253282e..2e1a2f3 100644 --- a/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG +## 1.5.3 - 2023-05-21 + +### Changed + +- Removed remaining usage of deprecated functions + ## 1.5.2 - 2022-08-07 ### Changed diff --git a/vendor/guzzlehttp/promises/composer.json b/vendor/guzzlehttp/promises/composer.json index c959fb3..966e3e3 100644 --- a/vendor/guzzlehttp/promises/composer.json +++ b/vendor/guzzlehttp/promises/composer.json @@ -46,11 +46,6 @@ "test": "vendor/bin/simple-phpunit", "test-ci": "vendor/bin/simple-phpunit --coverage-text" }, - "extra": { - "branch-alias": { - "dev-master": "1.5-dev" - } - }, "config": { "preferred-install": "dist", "sort-packages": true diff --git a/vendor/guzzlehttp/promises/src/Each.php b/vendor/guzzlehttp/promises/src/Each.php index 1dda354..ff8efd7 100644 --- a/vendor/guzzlehttp/promises/src/Each.php +++ b/vendor/guzzlehttp/promises/src/Each.php @@ -78,7 +78,7 @@ public static function ofLimitAll( $concurrency, callable $onFulfilled = null ) { - return each_limit( + return self::ofLimit( $iterable, $concurrency, $onFulfilled, diff --git a/vendor/guzzlehttp/promises/src/Utils.php b/vendor/guzzlehttp/promises/src/Utils.php index 8647126..e376188 100644 --- a/vendor/guzzlehttp/promises/src/Utils.php +++ b/vendor/guzzlehttp/promises/src/Utils.php @@ -107,7 +107,7 @@ public static function inspectAll($promises) { $results = []; foreach ($promises as $key => $promise) { - $results[$key] = inspect($promise); + $results[$key] = self::inspect($promise); } return $results; diff --git a/vendor/guzzlehttp/psr7/CHANGELOG.md b/vendor/guzzlehttp/psr7/CHANGELOG.md index fa716c0..d897fee 100644 --- a/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -5,7 +5,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.6.1 - 2023-08-27 + +### Fixed + +- Properly handle the fact that PHP transforms numeric strings in array keys to ints + +## 2.6.0 - 2023-08-03 + +### Changed + +- Updated the mime type map to add some new entries, fix a couple of invalid entries, and remove an invalid entry +- Fallback to `application/octet-stream` if we are unable to guess the content type for a multipart file upload + +## 2.5.1 - 2023-08-03 + +### Fixed + +- Corrected mime type for `.acc` files to `audio/aac` + +### Changed + +- PHP 8.3 support ## 2.5.0 - 2023-04-17 diff --git a/vendor/guzzlehttp/psr7/README.md b/vendor/guzzlehttp/psr7/README.md index 9566a7d..a64ec90 100644 --- a/vendor/guzzlehttp/psr7/README.md +++ b/vendor/guzzlehttp/psr7/README.md @@ -8,16 +8,24 @@ functionality like query string parsing. ![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) -# Installation +## Features + +This package comes with a number of stream implementations and stream +decorators. + + +## Installation ```shell composer require guzzlehttp/psr7 ``` -# Stream implementation +## Version Guidance -This package comes with a number of stream implementations and stream -decorators. +| Version | Status | PHP Version | +|---------|---------------------|--------------| +| 1.x | Security fixes only | >=5.4,<8.1 | +| 2.x | Latest | >=7.2.5,<8.4 | ## AppendStream @@ -855,14 +863,6 @@ This of course assumes they will be resolved against the same base URI. If this equivalence or difference of relative references does not mean anything. -## Version Guidance - -| Version | Status | PHP Version | -|---------|----------------|------------------| -| 1.x | Security fixes | >=5.4,<8.1 | -| 2.x | Latest | ^7.2.5 \|\| ^8.0 | - - ## Security If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. diff --git a/vendor/guzzlehttp/psr7/src/AppendStream.php b/vendor/guzzlehttp/psr7/src/AppendStream.php index cbcfaee..ee8f378 100644 --- a/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -40,12 +40,14 @@ public function __toString(): string { try { $this->rewind(); + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -138,9 +140,9 @@ public function getSize(): ?int public function eof(): bool { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); + return !$this->streams + || ($this->current >= count($this->streams) - 1 + && $this->streams[$this->current]->eof()); } public function rewind(): void @@ -167,7 +169,7 @@ public function seek($offset, $whence = SEEK_SET): void $stream->rewind(); } catch (\Exception $e) { throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); + .$i.' of the AppendStream', 0, $e); } } @@ -197,7 +199,7 @@ public function read($length): string if ($this->current === $total) { break; } - $this->current++; + ++$this->current; } $result = $this->streams[$this->current]->read($remaining); @@ -237,8 +239,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/vendor/guzzlehttp/psr7/src/BufferStream.php b/vendor/guzzlehttp/psr7/src/BufferStream.php index 21be8c0..2b0eb77 100644 --- a/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -134,8 +134,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/vendor/guzzlehttp/psr7/src/FnStream.php b/vendor/guzzlehttp/psr7/src/FnStream.php index 3a1a951..9fdddb9 100644 --- a/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/vendor/guzzlehttp/psr7/src/FnStream.php @@ -18,7 +18,7 @@ final class FnStream implements StreamInterface private const SLOTS = [ '__toString', 'close', 'detach', 'rewind', 'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write', - 'isReadable', 'read', 'getContents', 'getMetadata' + 'isReadable', 'read', 'getContents', 'getMetadata', ]; /** @var array */ @@ -33,7 +33,7 @@ public function __construct(array $methods) // Create the functions on the class foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; + $this->{'_fn_'.$name} = $fn; } } @@ -45,7 +45,7 @@ public function __construct(array $methods) public function __get(string $name): void { throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); + .'() is not implemented in the FnStream'); } /** @@ -99,6 +99,7 @@ public function __toString(): string throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -169,8 +170,6 @@ public function getContents(): string } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/vendor/guzzlehttp/psr7/src/Header.php b/vendor/guzzlehttp/psr7/src/Header.php index 4d7005b..6e38e00 100644 --- a/vendor/guzzlehttp/psr7/src/Header.php +++ b/vendor/guzzlehttp/psr7/src/Header.php @@ -89,7 +89,7 @@ public static function splitList($values): array $v = ''; $isQuoted = false; $isEscaped = false; - for ($i = 0, $max = \strlen($value); $i < $max; $i++) { + for ($i = 0, $max = \strlen($value); $i < $max; ++$i) { if ($isEscaped) { $v .= $value[$i]; $isEscaped = false; diff --git a/vendor/guzzlehttp/psr7/src/HttpFactory.php b/vendor/guzzlehttp/psr7/src/HttpFactory.php index 30be222..73d17e3 100644 --- a/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ b/vendor/guzzlehttp/psr7/src/HttpFactory.php @@ -23,13 +23,7 @@ * Note: in consuming code it is recommended to require the implemented interfaces * and inject the instance of this class multiple times. */ -final class HttpFactory implements - RequestFactoryInterface, - ResponseFactoryInterface, - ServerRequestFactoryInterface, - StreamFactoryInterface, - UploadedFileFactoryInterface, - UriFactoryInterface +final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface { public function createUploadedFile( StreamInterface $stream, diff --git a/vendor/guzzlehttp/psr7/src/InflateStream.php b/vendor/guzzlehttp/psr7/src/InflateStream.php index 8e00f1c..599b55d 100644 --- a/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -13,9 +13,9 @@ * then appends the zlib.inflate filter. The stream is then converted back * to a Guzzle stream resource to be used as a Guzzle stream. * - * @link http://tools.ietf.org/html/rfc1950 - * @link http://tools.ietf.org/html/rfc1952 - * @link http://php.net/manual/en/filters.compression.php + * @see http://tools.ietf.org/html/rfc1950 + * @see http://tools.ietf.org/html/rfc1952 + * @see http://php.net/manual/en/filters.compression.php */ final class InflateStream implements StreamInterface { diff --git a/vendor/guzzlehttp/psr7/src/Message.php b/vendor/guzzlehttp/psr7/src/Message.php index c1e15f8..6e6c3e5 100644 --- a/vendor/guzzlehttp/psr7/src/Message.php +++ b/vendor/guzzlehttp/psr7/src/Message.php @@ -18,31 +18,31 @@ final class Message public static function toString(MessageInterface $message): string { if ($message instanceof RequestInterface) { - $msg = trim($message->getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); + $msg = trim($message->getMethod().' ' + .$message->getRequestTarget()) + .' HTTP/'.$message->getProtocolVersion(); if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); + $msg .= "\r\nHost: ".$message->getUri()->getHost(); } } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); + $msg = 'HTTP/'.$message->getProtocolVersion().' ' + .$message->getStatusCode().' ' + .$message->getReasonPhrase(); } else { throw new \InvalidArgumentException('Unknown message type'); } foreach ($message->getHeaders() as $name => $values) { - if (strtolower($name) === 'set-cookie') { + if (is_string($name) && strtolower($name) === 'set-cookie') { foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; + $msg .= "\r\n{$name}: ".$value; } } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); + $msg .= "\r\n{$name}: ".implode(', ', $values); } } - return "{$msg}\r\n\r\n" . $message->getBody(); + return "{$msg}\r\n\r\n".$message->getBody(); } /** @@ -190,7 +190,7 @@ public static function parseRequestUri(string $path, array $headers): string $host = $headers[reset($hostKey)][0]; $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - return $scheme . '://' . $host . '/' . ltrim($path, '/'); + return $scheme.'://'.$host.'/'.ltrim($path, '/'); } /** @@ -231,7 +231,7 @@ public static function parseResponse(string $message): ResponseInterface // between status-code and reason-phrase is required. But browsers accept // responses without space and reason as well. if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']); } $parts = explode(' ', $data['start-line'], 3); diff --git a/vendor/guzzlehttp/psr7/src/MessageTrait.php b/vendor/guzzlehttp/psr7/src/MessageTrait.php index 464bdfa..e05ebea 100644 --- a/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -12,11 +12,11 @@ */ trait MessageTrait { - /** @var array Map of all registered headers, as original name => array of values */ + /** @var string[][] Map of all registered headers, as original name => array of values */ private $headers = []; - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; + /** @var string[] Map of lowercase header name => original name at registration */ + private $headerNames = []; /** @var string */ private $protocol = '1.1'; @@ -37,6 +37,7 @@ public function withProtocolVersion($version): MessageInterface $new = clone $this; $new->protocol = $version; + return $new; } @@ -135,6 +136,7 @@ public function withBody(StreamInterface $body): MessageInterface $new = clone $this; $new->stream = $body; + return $new; } @@ -224,7 +226,7 @@ private function assertHeader($header): void )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { throw new \InvalidArgumentException( sprintf('"%s" is not valid header name.', $header) ); @@ -254,7 +256,7 @@ private function assertValue(string $value): void // Clients must not send a request with line folding and a server sending folded headers is // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting // folding is not likely to break any legitimate use case. - if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + if (!preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { throw new \InvalidArgumentException( sprintf('"%s" is not valid header value.', $value) ); diff --git a/vendor/guzzlehttp/psr7/src/MimeType.php b/vendor/guzzlehttp/psr7/src/MimeType.php index 0debbd1..b131bdb 100644 --- a/vendor/guzzlehttp/psr7/src/MimeType.php +++ b/vendor/guzzlehttp/psr7/src/MimeType.php @@ -18,7 +18,7 @@ final class MimeType '7zip' => 'application/x-7z-compressed', '123' => 'application/vnd.lotus-1-2-3', 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-acc', + 'aac' => 'audio/aac', 'aam' => 'application/x-authorware-map', 'aas' => 'application/x-authorware-seg', 'abw' => 'application/x-abiword', @@ -29,6 +29,7 @@ final class MimeType 'acu' => 'application/vnd.acucobol', 'acutc' => 'application/vnd.acucorp', 'adp' => 'audio/adpcm', + 'adts' => 'audio/aac', 'aep' => 'application/vnd.audiograph', 'afm' => 'application/x-font-type1', 'afp' => 'application/vnd.ibm.modcap', @@ -41,11 +42,16 @@ final class MimeType 'air' => 'application/vnd.adobe.air-application-installer-package+zip', 'ait' => 'application/vnd.dvb.ait', 'ami' => 'application/vnd.amiga.ami', + 'aml' => 'application/automationml-aml+xml', + 'amlx' => 'application/automationml-amlx+zip', 'amr' => 'audio/amr', 'apk' => 'application/vnd.android.package-archive', 'apng' => 'image/apng', 'appcache' => 'text/cache-manifest', + 'appinstaller' => 'application/appinstaller', 'application' => 'application/x-ms-application', + 'appx' => 'application/appx', + 'appxbundle' => 'application/appxbundle', 'apr' => 'application/vnd.lotus-approach', 'arc' => 'application/x-freearc', 'arj' => 'application/x-arj', @@ -90,6 +96,7 @@ final class MimeType 'bpk' => 'application/octet-stream', 'bpmn' => 'application/octet-stream', 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btf' => 'image/prs.btif', 'btif' => 'image/prs.btif', 'buffer' => 'application/octet-stream', 'bz' => 'application/x-bzip', @@ -141,6 +148,7 @@ final class MimeType 'cjs' => 'application/node', 'cla' => 'application/vnd.claymore', 'class' => 'application/octet-stream', + 'cld' => 'model/vnd.cld', 'clkk' => 'application/vnd.crick.clicker.keyboard', 'clkp' => 'application/vnd.crick.clicker.palette', 'clkt' => 'application/vnd.crick.clicker.template', @@ -175,6 +183,7 @@ final class MimeType 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'curl' => 'text/vnd.curl', + 'cwl' => 'application/cwl', 'cww' => 'application/prs.cww', 'cxt' => 'application/x-director', 'cxx' => 'text/x-c', @@ -197,6 +206,7 @@ final class MimeType 'der' => 'application/x-x509-ca-cert', 'dfac' => 'application/vnd.dreamfactory', 'dgc' => 'application/x-dgc-compressed', + 'dib' => 'image/bmp', 'dic' => 'text/x-c', 'dir' => 'application/x-director', 'dis' => 'application/vnd.mobius.dis', @@ -219,6 +229,7 @@ final class MimeType 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dp' => 'application/vnd.osgi.dp', 'dpg' => 'application/vnd.dpgraph', + 'dpx' => 'image/dpx', 'dra' => 'audio/vnd.dra', 'drle' => 'image/dicom-rle', 'dsc' => 'text/prs.lines.tag', @@ -255,7 +266,6 @@ final class MimeType 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', - 'es' => 'application/ecmascript', 'es3' => 'application/vnd.eszigno3+xml', 'esa' => 'application/vnd.osgi.subsystem', 'esf' => 'application/vnd.epson.esf', @@ -448,6 +458,7 @@ final class MimeType 'jsonld' => 'application/ld+json', 'jsonml' => 'application/jsonml+json', 'jsx' => 'text/jsx', + 'jt' => 'model/jt', 'jxr' => 'image/jxr', 'jxra' => 'image/jxra', 'jxrs' => 'image/jxrs', @@ -552,7 +563,7 @@ final class MimeType 'mime' => 'message/rfc822', 'mj2' => 'video/mj2', 'mjp2' => 'video/mj2', - 'mjs' => 'application/javascript', + 'mjs' => 'text/javascript', 'mk3d' => 'video/x-matroska', 'mka' => 'audio/x-matroska', 'mkd' => 'text/x-markdown', @@ -602,6 +613,8 @@ final class MimeType 'msg' => 'application/vnd.ms-outlook', 'msh' => 'model/mesh', 'msi' => 'application/x-msdownload', + 'msix' => 'application/msix', + 'msixbundle' => 'application/msixbundle', 'msl' => 'application/vnd.mobius.msl', 'msm' => 'application/octet-stream', 'msp' => 'application/octet-stream', @@ -775,6 +788,8 @@ final class MimeType 'pvb' => 'application/vnd.3gpp.pic-bw-var', 'pwn' => 'application/vnd.3m.post-it-notes', 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyo' => 'model/vnd.pytha.pyox', + 'pyox' => 'model/vnd.pytha.pyox', 'pyv' => 'video/vnd.ms-playready.media.pyv', 'qam' => 'application/vnd.epson.quickanime', 'qbo' => 'application/vnd.intu.qbo', @@ -923,10 +938,12 @@ final class MimeType 'st' => 'application/vnd.sailingtracker.track', 'stc' => 'application/vnd.sun.xml.calc.template', 'std' => 'application/vnd.sun.xml.draw.template', + 'step' => 'application/STEP', 'stf' => 'application/vnd.wt.stf', 'sti' => 'application/vnd.sun.xml.impress.template', 'stk' => 'application/hyperstudio', 'stl' => 'model/stl', + 'stp' => 'application/STEP', 'stpx' => 'model/step+xml', 'stpxz' => 'model/step-xml+zip', 'stpz' => 'model/step+zip', @@ -1013,10 +1030,12 @@ final class MimeType 'ulx' => 'application/x-glulx', 'umj' => 'application/vnd.umajin', 'unityweb' => 'application/vnd.unity', + 'uo' => 'application/vnd.uoml+xml', 'uoml' => 'application/vnd.uoml+xml', 'uri' => 'text/uri-list', 'uris' => 'text/uri-list', 'urls' => 'text/uri-list', + 'usda' => 'model/vnd.usda', 'usdz' => 'model/vnd.usdz+zip', 'ustar' => 'application/x-ustar', 'utz' => 'application/vnd.uiq.theme', @@ -1096,6 +1115,7 @@ final class MimeType 'webmanifest' => 'application/manifest+json', 'webp' => 'image/webp', 'wg' => 'application/vnd.pmi.widget', + 'wgsl' => 'text/wgsl', 'wgt' => 'application/widget', 'wif' => 'application/watcherinfo+xml', 'wks' => 'application/vnd.ms-works', @@ -1150,9 +1170,10 @@ final class MimeType 'xel' => 'application/xcap-el+xml', 'xenc' => 'application/xenc+xml', 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', + 'xfdf' => 'application/xfdf', 'xfdl' => 'application/vnd.xfdl', 'xht' => 'application/xhtml+xml', + 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', 'xhtml' => 'application/xhtml+xml', 'xhvml' => 'application/xv+xml', 'xif' => 'image/vnd.xiff', @@ -1183,6 +1204,7 @@ final class MimeType 'xpw' => 'application/vnd.intercon.formnet', 'xpx' => 'application/vnd.intercon.formnet', 'xsd' => 'application/xml', + 'xsf' => 'application/prs.xsf+xml', 'xsl' => 'application/xml', 'xslt' => 'application/xslt+xml', 'xsm' => 'application/vnd.syncml+xml', @@ -1218,7 +1240,7 @@ final class MimeType /** * Determines the mimetype of a file by looking at its extension. * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromFilename(string $filename): ?string { @@ -1228,7 +1250,7 @@ public static function fromFilename(string $filename): ?string /** * Maps a file extensions to a mimetype. * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromExtension(string $extension): ?string { diff --git a/vendor/guzzlehttp/psr7/src/MultipartStream.php b/vendor/guzzlehttp/psr7/src/MultipartStream.php index 3e12b74..41c48ee 100644 --- a/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -60,7 +60,7 @@ private function getHeaders(array $headers): string $str .= "{$key}: {$value}\r\n"; } - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + return "--{$this->boundary}\r\n".trim($str)."\r\n\r\n"; } /** @@ -72,7 +72,7 @@ protected function createStream(array $elements = []): StreamInterface foreach ($elements as $element) { if (!is_array($element)) { - throw new \UnexpectedValueException("An array is expected"); + throw new \UnexpectedValueException('An array is expected'); } $this->addElement($stream, $element); } @@ -137,9 +137,7 @@ private function createElement(string $name, StreamInterface $stream, ?string $f // Set a default Content-Type if one was not supplied $type = $this->getHeader($headers, 'content-type'); if (!$type && ($filename === '0' || $filename)) { - if ($type = MimeType::fromFilename($filename)) { - $headers['Content-Type'] = $type; - } + $headers['Content-Type'] = MimeType::fromFilename($filename) ?? 'application/octet-stream'; } return [$stream, $headers]; diff --git a/vendor/guzzlehttp/psr7/src/PumpStream.php b/vendor/guzzlehttp/psr7/src/PumpStream.php index e90389c..5585190 100644 --- a/vendor/guzzlehttp/psr7/src/PumpStream.php +++ b/vendor/guzzlehttp/psr7/src/PumpStream.php @@ -34,7 +34,7 @@ final class PumpStream implements StreamInterface private $buffer; /** - * @param callable(int): (string|null|false) $source Source of the stream data. The callable MAY + * @param callable(int): (string|false|null) $source Source of the stream data. The callable MAY * accept an integer argument used to control the * amount of data to return. The callable MUST * return a string when called, or false|null on error @@ -60,6 +60,7 @@ public function __toString(): string throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -149,8 +150,6 @@ public function getContents(): string } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) @@ -169,6 +168,7 @@ private function pump(int $length): void $data = call_user_func($this->source, $length); if ($data === false || $data === null) { $this->source = null; + return; } $this->buffer->write($data); diff --git a/vendor/guzzlehttp/psr7/src/Query.php b/vendor/guzzlehttp/psr7/src/Query.php index 2faab3a..8b94927 100644 --- a/vendor/guzzlehttp/psr7/src/Query.php +++ b/vendor/guzzlehttp/psr7/src/Query.php @@ -93,7 +93,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri $qs .= $k; $v = is_bool($v) ? (int) $v : $v; if ($v !== null) { - $qs .= '=' . $encoder((string) $v); + $qs .= '='.$encoder((string) $v); } $qs .= '&'; } else { @@ -101,7 +101,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri $qs .= $k; $vv = is_bool($vv) ? (int) $vv : $vv; if ($vv !== null) { - $qs .= '=' . $encoder((string) $vv); + $qs .= '='.$encoder((string) $vv); } $qs .= '&'; } diff --git a/vendor/guzzlehttp/psr7/src/Request.php b/vendor/guzzlehttp/psr7/src/Request.php index b17af66..db29d95 100644 --- a/vendor/guzzlehttp/psr7/src/Request.php +++ b/vendor/guzzlehttp/psr7/src/Request.php @@ -69,7 +69,7 @@ public function getRequestTarget(): string $target = '/'; } if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); + $target .= '?'.$this->uri->getQuery(); } return $target; @@ -85,6 +85,7 @@ public function withRequestTarget($requestTarget): RequestInterface $new = clone $this; $new->requestTarget = $requestTarget; + return $new; } @@ -98,6 +99,7 @@ public function withMethod($method): RequestInterface $this->assertMethod($method); $new = clone $this; $new->method = strtoupper($method); + return $new; } @@ -131,7 +133,7 @@ private function updateHostFromUri(): void } if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; + $host .= ':'.$port; } if (isset($this->headerNames['host'])) { diff --git a/vendor/guzzlehttp/psr7/src/Response.php b/vendor/guzzlehttp/psr7/src/Response.php index 4c6ee6f..8fc1147 100644 --- a/vendor/guzzlehttp/psr7/src/Response.php +++ b/vendor/guzzlehttp/psr7/src/Response.php @@ -138,6 +138,7 @@ public function withStatus($code, $reasonPhrase = ''): ResponseInterface $reasonPhrase = self::PHRASES[$new->statusCode]; } $new->reasonPhrase = (string) $reasonPhrase; + return $new; } diff --git a/vendor/guzzlehttp/psr7/src/Rfc7230.php b/vendor/guzzlehttp/psr7/src/Rfc7230.php index 3022401..8219dba 100644 --- a/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -14,7 +14,7 @@ final class Rfc7230 * * Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons. * - * @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 + * @see https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 * * @license https://github.com/amphp/http/blob/v1.0.1/LICENSE */ diff --git a/vendor/guzzlehttp/psr7/src/ServerRequest.php b/vendor/guzzlehttp/psr7/src/ServerRequest.php index b2aa382..c852d96 100644 --- a/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -144,10 +144,10 @@ private static function normalizeNestedFileSpec(array $files = []): array foreach (array_keys($files['tmp_name']) as $key) { $spec = [ 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key] ?? null, - 'error' => $files['error'][$key] ?? null, - 'name' => $files['name'][$key] ?? null, - 'type' => $files['type'][$key] ?? null, + 'size' => $files['size'][$key] ?? null, + 'error' => $files['error'][$key] ?? null, + 'name' => $files['name'][$key] ?? null, + 'type' => $files['type'][$key] ?? null, ]; $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); } @@ -182,7 +182,7 @@ public static function fromGlobals(): ServerRequestInterface private static function extractHostAndPortFromAuthority(string $authority): array { - $uri = 'http://' . $authority; + $uri = 'http://'.$authority; $parts = parse_url($uri); if (false === $parts) { return [null, null]; @@ -286,8 +286,6 @@ public function withQueryParams(array $query): ServerRequestInterface } /** - * {@inheritdoc} - * * @return array|object|null */ public function getParsedBody() @@ -309,8 +307,6 @@ public function getAttributes(): array } /** - * {@inheritdoc} - * * @return mixed */ public function getAttribute($attribute, $default = null) diff --git a/vendor/guzzlehttp/psr7/src/Stream.php b/vendor/guzzlehttp/psr7/src/Stream.php index ecd3186..f730dda 100644 --- a/vendor/guzzlehttp/psr7/src/Stream.php +++ b/vendor/guzzlehttp/psr7/src/Stream.php @@ -61,8 +61,8 @@ public function __construct($stream, array $options = []) $this->stream = $stream; $meta = stream_get_meta_data($this->stream); $this->seekable = $meta['seekable']; - $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); - $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->readable = (bool) preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool) preg_match(self::WRITABLE_MODES, $meta['mode']); $this->uri = $this->getMetadata('uri'); } @@ -80,12 +80,14 @@ public function __toString(): string if ($this->isSeekable()) { $this->seek(0); } + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -145,6 +147,7 @@ public function getSize(): ?int $stats = fstat($this->stream); if (is_array($stats) && isset($stats['size'])) { $this->size = $stats['size']; + return $this->size; } @@ -207,7 +210,7 @@ public function seek($offset, $whence = SEEK_SET): void } if (fseek($this->stream, $offset, $whence) === -1) { throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); + .$offset.' with whence '.var_export($whence, true)); } } @@ -261,8 +264,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 56d4104..96196a3 100644 --- a/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -31,6 +31,7 @@ public function __get(string $name) { if ($name === 'stream') { $this->stream = $this->createStream(); + return $this->stream; } @@ -43,12 +44,14 @@ public function __toString(): string if ($this->isSeekable()) { $this->seek(0); } + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -79,8 +82,6 @@ public function close(): void } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/vendor/guzzlehttp/psr7/src/StreamWrapper.php index 2a93464..b3655cb 100644 --- a/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -41,7 +41,7 @@ public static function getResource(StreamInterface $stream) $mode = 'w'; } else { throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); + .'writable, or both.'); } return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); @@ -55,7 +55,7 @@ public static function getResource(StreamInterface $stream) public static function createStreamContext(StreamInterface $stream) { return stream_context_create([ - 'guzzle' => ['stream' => $stream] + 'guzzle' => ['stream' => $stream], ]); } @@ -115,7 +115,7 @@ public function stream_seek(int $offset, int $whence): bool */ public function stream_cast(int $cast_as) { - $stream = clone($this->stream); + $stream = clone $this->stream; $resource = $stream->detach(); return $resource ?? false; @@ -127,27 +127,27 @@ public function stream_cast(int $cast_as) public function stream_stat(): array { static $modeMap = [ - 'r' => 33060, + 'r' => 33060, 'rb' => 33060, 'r+' => 33206, - 'w' => 33188, - 'wb' => 33188 + 'w' => 33188, + 'wb' => 33188, ]; return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, 'blksize' => 0, - 'blocks' => 0 + 'blocks' => 0, ]; } @@ -157,19 +157,19 @@ public function stream_stat(): array public function url_stat(string $path, int $flags): array { return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, 'blksize' => 0, - 'blocks' => 0 + 'blocks' => 0, ]; } } diff --git a/vendor/guzzlehttp/psr7/src/Uri.php b/vendor/guzzlehttp/psr7/src/Uri.php index 09e878d..fbba7f1 100644 --- a/vendor/guzzlehttp/psr7/src/Uri.php +++ b/vendor/guzzlehttp/psr7/src/Uri.php @@ -25,7 +25,7 @@ class Uri implements UriInterface, \JsonSerializable private const HTTP_DEFAULT_HOST = 'localhost'; private const DEFAULT_PORTS = [ - 'http' => 80, + 'http' => 80, 'https' => 443, 'ftp' => 21, 'gopher' => 70, @@ -41,14 +41,14 @@ class Uri implements UriInterface, \JsonSerializable /** * Unreserved characters for use in a regex. * - * @link https://tools.ietf.org/html/rfc3986#section-2.3 + * @see https://tools.ietf.org/html/rfc3986#section-2.3 */ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; /** * Sub-delims for use in a regex. * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 + * @see https://tools.ietf.org/html/rfc3986#section-2.2 */ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; @@ -87,6 +87,7 @@ public function __construct(string $uri = '') $this->applyParts($parts); } } + /** * UTF-8 aware \parse_url() replacement. * @@ -121,7 +122,7 @@ static function ($matches) { $url ); - $result = parse_url($prefix . $encodedUrl); + $result = parse_url($prefix.$encodedUrl); if ($result === false) { return false; @@ -161,7 +162,7 @@ public function __toString(): string * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to * that format). * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 + * @see https://tools.ietf.org/html/rfc3986#section-5.3 */ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string { @@ -169,25 +170,25 @@ public static function composeComponents(?string $scheme, ?string $authority, st // weak type checks to also accept null until we can add scalar type hints if ($scheme != '') { - $uri .= $scheme . ':'; + $uri .= $scheme.':'; } if ($authority != '' || $scheme === 'file') { - $uri .= '//' . $authority; + $uri .= '//'.$authority; } if ($authority != '' && $path != '' && $path[0] != '/') { - $path = '/' . $path; + $path = '/'.$path; } $uri .= $path; if ($query != '') { - $uri .= '?' . $query; + $uri .= '?'.$query; } if ($fragment != '') { - $uri .= '#' . $fragment; + $uri .= '#'.$fragment; } return $uri; @@ -218,7 +219,7 @@ public static function isDefaultPort(UriInterface $uri): bool * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 + * @see https://tools.ietf.org/html/rfc3986#section-4 */ public static function isAbsolute(UriInterface $uri): bool { @@ -230,7 +231,7 @@ public static function isAbsolute(UriInterface $uri): bool * * A relative reference that begins with two slash characters is termed an network-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri): bool { @@ -242,7 +243,7 @@ public static function isNetworkPathReference(UriInterface $uri): bool * * A relative reference that begins with a single slash character is termed an absolute-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri): bool { @@ -257,7 +258,7 @@ public static function isAbsolutePathReference(UriInterface $uri): bool * * A relative reference that does not begin with a slash character is termed a relative-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri): bool { @@ -276,7 +277,7 @@ public static function isRelativePathReference(UriInterface $uri): bool * @param UriInterface $uri The URI to check * @param UriInterface|null $base An optional base URI to compare against * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 + * @see https://tools.ietf.org/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool { @@ -352,7 +353,7 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray): /** * Creates a URI from a hash of `parse_url` components. * - * @link http://php.net/manual/en/function.parse-url.php + * @see http://php.net/manual/en/function.parse-url.php * * @throws MalformedUriException If the components do not form a valid URI. */ @@ -374,11 +375,11 @@ public function getAuthority(): string { $authority = $this->host; if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; + $authority = $this->userInfo.'@'.$authority; } if ($this->port !== null) { - $authority .= ':' . $this->port; + $authority .= ':'.$this->port; } return $authority; @@ -435,7 +436,7 @@ public function withUserInfo($user, $password = null): UriInterface { $info = $this->filterUserInfoComponent($user); if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); + $info .= ':'.$this->filterUserInfoComponent($password); } if ($this->userInfo === $info) { @@ -563,7 +564,7 @@ private function applyParts(array $parts): void ? $this->filterQueryAndFragment($parts['fragment']) : ''; if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + $this->userInfo .= ':'.$this->filterUserInfoComponent($parts['pass']); } $this->removeDefaultPort(); @@ -595,7 +596,7 @@ private function filterUserInfoComponent($component): string } return preg_replace_callback( - '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $component ); @@ -627,7 +628,7 @@ private function filterPort($port): ?int } $port = (int) $port; - if (0 > $port || 0xffff < $port) { + if (0 > $port || 0xFFFF < $port) { throw new \InvalidArgumentException( sprintf('Invalid port: %d. Must be between 0 and 65535', $port) ); @@ -664,7 +665,7 @@ private static function generateQueryString(string $key, ?string $value): string $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); if ($value !== null) { - $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); + $queryString .= '='.strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); } return $queryString; @@ -691,7 +692,7 @@ private function filterPath($path): string } return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $path ); @@ -711,7 +712,7 @@ private function filterQueryAndFragment($str): string } return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $str ); diff --git a/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/vendor/guzzlehttp/psr7/src/UriNormalizer.php index e12971e..cd4c383 100644 --- a/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -11,7 +11,7 @@ * * @author Tobias Schultze * - * @link https://tools.ietf.org/html/rfc3986#section-6 + * @see https://tools.ietf.org/html/rfc3986#section-6 */ final class UriNormalizer { @@ -119,7 +119,7 @@ final class UriNormalizer * @param UriInterface $uri The URI to normalize * @param int $flags A bitmask of normalizations to apply, see constants * - * @link https://tools.ietf.org/html/rfc3986#section-6.2 + * @see https://tools.ietf.org/html/rfc3986#section-6.2 */ public static function normalize(UriInterface $uri, int $flags = self::PRESERVING_NORMALIZATIONS): UriInterface { @@ -131,8 +131,8 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN $uri = self::decodeUnreservedCharacters($uri); } - if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' + && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') ) { $uri = $uri->withPath('/'); } @@ -174,7 +174,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN * @param UriInterface $uri2 An URI to compare * @param int $normalizations A bitmask of normalizations to apply, see constants * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 + * @see https://tools.ietf.org/html/rfc3986#section-6.1 */ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool { diff --git a/vendor/guzzlehttp/psr7/src/UriResolver.php b/vendor/guzzlehttp/psr7/src/UriResolver.php index 426e5c9..38d5793 100644 --- a/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -11,14 +11,14 @@ * * @author Tobias Schultze * - * @link https://tools.ietf.org/html/rfc3986#section-5 + * @see https://tools.ietf.org/html/rfc3986#section-5 */ final class UriResolver { /** * Removes dot segments from a path and returns the new path. * - * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 + * @see http://tools.ietf.org/html/rfc3986#section-5.2.4 */ public static function removeDotSegments(string $path): string { @@ -40,7 +40,7 @@ public static function removeDotSegments(string $path): string if ($path[0] === '/' && (!isset($newPath[0]) || $newPath[0] !== '/')) { // Re-add the leading slash if necessary for cases like "/.." - $newPath = '/' . $newPath; + $newPath = '/'.$newPath; } elseif ($newPath !== '' && ($segment === '.' || $segment === '..')) { // Add the trailing slash if necessary // If newPath is not empty, then $segment must be set and is the last segment from the foreach @@ -53,7 +53,7 @@ public static function removeDotSegments(string $path): string /** * Converts the relative URI into a new URI that is resolved against the base URI. * - * @link http://tools.ietf.org/html/rfc3986#section-5.2 + * @see http://tools.ietf.org/html/rfc3986#section-5.2 */ public static function resolve(UriInterface $base, UriInterface $rel): UriInterface { @@ -80,13 +80,13 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf $targetPath = $rel->getPath(); } else { if ($targetAuthority != '' && $base->getPath() === '') { - $targetPath = '/' . $rel->getPath(); + $targetPath = '/'.$rel->getPath(); } else { $lastSlashPos = strrpos($base->getPath(), '/'); if ($lastSlashPos === false) { $targetPath = $rel->getPath(); } else { - $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath(); } } } @@ -127,8 +127,8 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf */ public static function relativize(UriInterface $base, UriInterface $target): UriInterface { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + if ($target->getScheme() !== '' + && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') ) { return $target; } @@ -185,7 +185,7 @@ private static function getRelativePath(UriInterface $base, UriInterface $target } } $targetSegments[] = $targetLastSegment; - $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments); // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used diff --git a/vendor/guzzlehttp/psr7/src/Utils.php b/vendor/guzzlehttp/psr7/src/Utils.php index 3a4cf39..917c05e 100644 --- a/vendor/guzzlehttp/psr7/src/Utils.php +++ b/vendor/guzzlehttp/psr7/src/Utils.php @@ -90,6 +90,7 @@ public static function copyToString(StreamInterface $stream, int $maxLen = -1): } $buffer .= $buf; } + return $buffer; } @@ -174,7 +175,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): $standardPorts = ['http' => 80, 'https' => 443]; $scheme = $changes['uri']->getScheme(); if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; + $changes['set_headers']['Host'] .= ':'.$port; } } } @@ -230,7 +231,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length */ - public static function readLine(StreamInterface $stream, ?int $maxLength = null): string + public static function readLine(StreamInterface $stream, int $maxLength = null): string { $buffer = ''; $size = 0; @@ -291,6 +292,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt fwrite($stream, (string) $resource); fseek($stream, 0); } + return new Stream($stream, $options); } @@ -308,6 +310,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt fseek($stream, 0); $resource = $stream; } + return new Stream($resource, $options); case 'object': /** @var object $resource */ @@ -320,6 +323,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt } $result = $resource->current(); $resource->next(); + return $result; }, $options); } elseif (method_exists($resource, '__toString')) { @@ -334,7 +338,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt return new PumpStream($resource, $options); } - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); } /** diff --git a/vendor/psr/http-client/CHANGELOG.md b/vendor/psr/http-client/CHANGELOG.md index e2dc25f..babba7c 100644 --- a/vendor/psr/http-client/CHANGELOG.md +++ b/vendor/psr/http-client/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.0.3 + +Add `source` link in composer.json. No code changes. + +## 1.0.2 + +Allow PSR-7 (psr/http-message) 2.0. No code changes. + ## 1.0.1 Allow installation with PHP 8. No code changes. diff --git a/vendor/psr/http-client/composer.json b/vendor/psr/http-client/composer.json index e4cab2f..6fed350 100644 --- a/vendor/psr/http-client/composer.json +++ b/vendor/psr/http-client/composer.json @@ -10,6 +10,9 @@ "homepage": "https://www.php-fig.org/" } ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, "require": { "php": "^7.0 || ^8.0", "psr/http-message": "^1.0 || ^2.0" diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json index 774200f..c6d02d8 100644 --- a/vendor/symfony/deprecation-contracts/composer.json +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.4-dev" }, "thanks": { "name": "symfony/contracts",