From caf0951f3552fc063fc328603fc5d4306713fdb2 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Fri, 3 Mar 2023 12:26:31 +0100 Subject: [PATCH 1/6] WIP: Split integrations into single images and turn to GH action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - adds integration.yml for integration tests - …where 389ds is added as service container and initialized in a later step after checkout - …and where a shibboleth server is also added service container TODOS: - [ ] double check integration tests config/paths/etc (was copy paste) Signed-off-by: Arthur Schiwon --- .drone.yml | 39 - .github/workflows/integration.yml | 138 ++ tests/integration/composer.json | 7 +- tests/integration/composer.lock | 231 +-- .../integration/data/98nextcloud-schema.ldif | 13 + tests/integration/data/entries.ldif | 64 + .../features/EnvironmentVariable.feature | 12 +- tests/integration/features/Shibboleth.feature | 20 +- .../features/bootstrap/FeatureContext.php | 34 +- tests/integration/vendor/autoload.php | 18 + .../vendor/behat/behat/CHANGELOG.md | 55 +- .../integration/vendor/behat/behat/README.md | 6 +- .../vendor/behat/behat/composer.json | 6 +- tests/integration/vendor/behat/behat/i18n.php | 72 +- .../integration/vendor/behat/behat/psalm.xml | 7 + .../src/Behat/Behat/ApplicationFactory.php | 2 +- .../Environment/ContextEnvironment.php | 5 +- .../InitializedContextEnvironment.php | 11 +- .../UninitializedContextEnvironment.php | 9 +- .../Attribute/DefinitionAttributeReader.php | 3 + .../BuiltInServiceContainer.php | 5 +- .../HelperContainer/ContainerInterface.php | 7 +- .../Context/Attribute/HookAttributeReader.php | 3 + .../JUnit/JUnitFeatureElementListener.php | 8 +- .../Printer/JUnit/JUnitScenarioPrinter.php | 21 +- .../Pretty/PrettyExampleRowPrinter.php | 21 +- .../Formatter/PrettyFormatterFactory.php | 3 +- .../Argument/MixedArgumentOrganiser.php | 3 + .../src/Behat/Testwork/Cli/Application.php | 2 +- .../EventDispatcher/Cli/SigintController.php | 4 + .../Stringer/PHPUnitExceptionStringer.php | 4 + .../Output/Printer/JUnitOutputPrinter.php | 2 +- .../Testwork/ServiceContainer/Extension.php | 4 +- .../vendor/behat/transliterator/CHANGELOG.md | 9 + .../vendor/behat/transliterator/README.md | 9 +- .../vendor/behat/transliterator/composer.json | 6 +- .../src/Behat/Transliterator/SyncTool.php | 12 +- .../src/Behat/Transliterator/data/x02.php | 4 +- .../src/Behat/Transliterator/data/x03.php | 2 +- .../src/Behat/Transliterator/data/x04.php | 2 +- .../src/Behat/Transliterator/data/x05.php | 2 +- .../src/Behat/Transliterator/data/x06.php | 2 +- .../src/Behat/Transliterator/data/x07.php | 2 +- .../src/Behat/Transliterator/data/x09.php | 2 +- .../src/Behat/Transliterator/data/x0a.php | 2 +- .../src/Behat/Transliterator/data/x0b.php | 2 +- .../src/Behat/Transliterator/data/x0c.php | 2 +- .../src/Behat/Transliterator/data/x0d.php | 2 +- .../src/Behat/Transliterator/data/x0e.php | 2 +- .../src/Behat/Transliterator/data/x0f.php | 2 +- .../src/Behat/Transliterator/data/x10.php | 2 +- .../src/Behat/Transliterator/data/x11.php | 2 +- .../src/Behat/Transliterator/data/x13.php | 2 +- .../src/Behat/Transliterator/data/x16.php | 2 +- .../src/Behat/Transliterator/data/x17.php | 2 +- .../src/Behat/Transliterator/data/x18.php | 2 +- .../src/Behat/Transliterator/data/x1e.php | 2 +- .../src/Behat/Transliterator/data/x1f.php | 2 +- .../src/Behat/Transliterator/data/x20.php | 2 +- .../src/Behat/Transliterator/data/x21.php | 2 +- .../src/Behat/Transliterator/data/x24.php | 2 +- .../src/Behat/Transliterator/data/x25.php | 2 +- .../src/Behat/Transliterator/data/x26.php | 2 +- .../src/Behat/Transliterator/data/x27.php | 2 +- .../src/Behat/Transliterator/data/x30.php | 2 +- .../src/Behat/Transliterator/data/x31.php | 2 +- .../src/Behat/Transliterator/data/x32.php | 2 +- .../src/Behat/Transliterator/data/x33.php | 2 +- .../src/Behat/Transliterator/data/x9f.php | 2 +- .../src/Behat/Transliterator/data/xa4.php | 2 +- .../src/Behat/Transliterator/data/xd7.php | 2 +- .../src/Behat/Transliterator/data/xfa.php | 2 +- .../src/Behat/Transliterator/data/xfd.php | 2 +- tests/integration/vendor/bin/behat | 20 +- tests/integration/vendor/bin/yaml-lint | 20 +- .../vendor/composer/ClassLoader.php | 137 +- .../vendor/composer/InstalledVersions.php | 33 +- .../vendor/composer/autoload_classmap.php | 3 +- .../vendor/composer/autoload_files.php | 7 +- .../vendor/composer/autoload_namespaces.php | 2 +- .../vendor/composer/autoload_psr4.php | 2 +- .../vendor/composer/autoload_real.php | 54 +- .../vendor/composer/autoload_static.php | 6 +- .../vendor/composer/installed.json | 434 +++--- .../integration/vendor/composer/installed.php | 168 +-- .../vendor/composer/platform_check.php | 4 +- .../vendor/guzzlehttp/guzzle/CHANGELOG.md | 136 +- .../vendor/guzzlehttp/guzzle/README.md | 28 +- .../vendor/guzzlehttp/guzzle/UPGRADING.md | 2 +- .../vendor/guzzlehttp/guzzle/composer.json | 19 +- .../vendor/guzzlehttp/guzzle/src/Client.php | 40 +- .../guzzlehttp/guzzle/src/ClientInterface.php | 2 +- .../guzzle/src/Cookie/CookieJar.php | 62 +- .../guzzle/src/Cookie/CookieJarInterface.php | 5 +- .../guzzle/src/Cookie/SessionCookieJar.php | 2 +- .../guzzle/src/Cookie/SetCookie.php | 90 +- .../guzzle/src/Handler/CurlFactory.php | 97 +- .../guzzle/src/Handler/CurlMultiHandler.php | 16 +- .../guzzle/src/Handler/EasyHandle.php | 2 +- .../guzzle/src/Handler/HeaderProcessor.php | 4 +- .../guzzle/src/Handler/MockHandler.php | 3 +- .../guzzle/src/Handler/StreamHandler.php | 75 +- .../guzzlehttp/guzzle/src/HandlerStack.php | 16 +- .../guzzle/src/MessageFormatter.php | 17 +- .../guzzle/src/MessageFormatterInterface.php | 2 +- .../guzzlehttp/guzzle/src/Middleware.php | 20 +- .../guzzle/src/PrepareBodyMiddleware.php | 1 + .../guzzle/src/RedirectMiddleware.php | 38 +- .../guzzlehttp/guzzle/src/RequestOptions.php | 16 +- .../guzzlehttp/guzzle/src/RetryMiddleware.php | 9 +- .../guzzlehttp/guzzle/src/TransferStats.php | 4 +- .../vendor/guzzlehttp/guzzle/src/Utils.php | 37 +- .../guzzlehttp/guzzle/src/functions.php | 8 +- .../guzzle/src/functions_include.php | 2 +- .../vendor/guzzlehttp/promises/CHANGELOG.md | 44 +- .../vendor/guzzlehttp/promises/Makefile | 13 - .../vendor/guzzlehttp/promises/README.md | 74 +- .../vendor/guzzlehttp/promises/composer.json | 20 +- .../promises/src/AggregateException.php | 4 +- .../promises/src/CancellationException.php | 2 + .../guzzlehttp/promises/src/Coroutine.php | 39 +- .../vendor/guzzlehttp/promises/src/Create.php | 21 +- .../vendor/guzzlehttp/promises/src/Each.php | 26 +- .../guzzlehttp/promises/src/EachPromise.php | 51 +- .../promises/src/FulfilledPromise.php | 29 +- .../vendor/guzzlehttp/promises/src/Is.php | 18 +- .../guzzlehttp/promises/src/Promise.php | 51 +- .../promises/src/PromiseInterface.php | 34 +- .../promises/src/PromisorInterface.php | 6 +- .../promises/src/RejectedPromise.php | 30 +- .../promises/src/RejectionException.php | 15 +- .../guzzlehttp/promises/src/TaskQueue.php | 16 +- .../promises/src/TaskQueueInterface.php | 10 +- .../vendor/guzzlehttp/promises/src/Utils.php | 69 +- .../guzzlehttp/promises/src/functions.php | 363 ----- .../promises/src/functions_include.php | 6 - .../vendor/guzzlehttp/psr7/CHANGELOG.md | 115 +- .../vendor/guzzlehttp/psr7/README.md | 65 +- .../vendor/guzzlehttp/psr7/composer.json | 14 +- .../guzzlehttp/psr7/src/AppendStream.php | 15 +- .../guzzlehttp/psr7/src/BufferStream.php | 2 - .../guzzlehttp/psr7/src/CachingStream.php | 5 + .../guzzlehttp/psr7/src/DroppingStream.php | 3 + .../vendor/guzzlehttp/psr7/src/FnStream.php | 10 +- .../vendor/guzzlehttp/psr7/src/Header.php | 105 +- .../guzzlehttp/psr7/src/HttpFactory.php | 8 +- .../guzzlehttp/psr7/src/InflateStream.php | 9 +- .../guzzlehttp/psr7/src/LazyOpenStream.php | 9 + .../guzzlehttp/psr7/src/LimitStream.php | 3 + .../vendor/guzzlehttp/psr7/src/Message.php | 32 +- .../guzzlehttp/psr7/src/MessageTrait.php | 64 +- .../vendor/guzzlehttp/psr7/src/MimeType.php | 1333 +++++++++++++++-- .../guzzlehttp/psr7/src/MultipartStream.php | 16 +- .../guzzlehttp/psr7/src/NoSeekStream.php | 3 + .../vendor/guzzlehttp/psr7/src/PumpStream.php | 6 +- .../vendor/guzzlehttp/psr7/src/Query.php | 6 +- .../vendor/guzzlehttp/psr7/src/Request.php | 6 +- .../vendor/guzzlehttp/psr7/src/Response.php | 1 + .../vendor/guzzlehttp/psr7/src/Rfc7230.php | 2 +- .../guzzlehttp/psr7/src/ServerRequest.php | 16 +- .../vendor/guzzlehttp/psr7/src/Stream.php | 26 +- .../psr7/src/StreamDecoratorTrait.php | 5 +- .../guzzlehttp/psr7/src/StreamWrapper.php | 60 +- .../vendor/guzzlehttp/psr7/src/Uri.php | 64 +- .../guzzlehttp/psr7/src/UriComparator.php | 52 + .../guzzlehttp/psr7/src/UriNormalizer.php | 10 +- .../guzzlehttp/psr7/src/UriResolver.php | 18 +- .../vendor/guzzlehttp/psr7/src/Utils.php | 61 +- .../vendor-bin/php-cs-fixer/composer.json | 9 - .../psr7/vendor-bin/phpstan/composer.json | 10 - .../psr7/vendor-bin/psalm/composer.json | 9 - .../vendor/psr/http-client/CHANGELOG.md | 8 + .../vendor/psr/http-client/README.md | 2 +- .../vendor/psr/http-client/composer.json | 7 +- .../vendor/psr/http-factory/.gitignore | 2 - .../vendor/psr/http-factory/.pullapprove.yml | 7 - .../vendor/psr/http-factory/README.md | 12 +- .../vendor/psr/http-factory/composer.json | 4 +- .../vendor/psr/http-message/README.md | 5 +- .../vendor/psr/http-message/composer.json | 6 +- .../psr/http-message/docs/PSR7-Interfaces.md | 130 ++ .../psr/http-message/docs/PSR7-Usage.md | 159 ++ .../psr/http-message/src/MessageInterface.php | 22 +- .../psr/http-message/src/RequestInterface.php | 15 +- .../http-message/src/ResponseInterface.php | 6 +- .../src/ServerRequestInterface.php | 24 +- .../psr/http-message/src/StreamInterface.php | 30 +- .../src/UploadedFileInterface.php | 12 +- .../psr/http-message/src/UriInterface.php | 33 +- .../symfony/config/Builder/ClassBuilder.php | 15 +- .../config/Builder/ConfigBuilderGenerator.php | 153 +- .../symfony/config/Builder/Property.php | 11 + .../symfony/config/Definition/BaseNode.php | 2 +- .../Definition/Dumper/XmlReferenceDumper.php | 2 +- .../symfony/config/Definition/Processor.php | 6 +- .../symfony/config/Definition/ScalarNode.php | 2 +- .../integration/vendor/symfony/config/LICENSE | 2 +- .../Resource/ClassExistenceResource.php | 2 +- .../symfony/config/Resource/GlobResource.php | 17 +- .../config/ResourceCheckerConfigCache.php | 2 +- .../Util/Exception/InvalidXmlException.php | 1 + .../vendor/symfony/console/Application.php | 69 +- .../symfony/console/Command/Command.php | 12 +- .../console/Command/CompleteCommand.php | 13 +- .../console/Command/DumpCompletionCommand.php | 34 +- .../Output/BashCompletionOutput.php | 3 + .../AddConsoleCommandPass.php | 4 +- .../Descriptor/ApplicationDescription.php | 2 +- .../Exception/InvalidOptionException.php | 2 +- .../Formatter/NullOutputFormatterStyle.php | 1 + .../console/Formatter/OutputFormatter.php | 11 +- .../Formatter/OutputFormatterStyle.php | 3 +- .../vendor/symfony/console/Helper/Helper.php | 2 + .../symfony/console/Helper/ProgressBar.php | 8 +- .../symfony/console/Helper/QuestionHelper.php | 18 +- .../vendor/symfony/console/Helper/Table.php | 119 +- .../symfony/console/Input/InputArgument.php | 4 +- .../vendor/symfony/console/LICENSE | 2 +- .../symfony/console/Logger/ConsoleLogger.php | 2 +- .../symfony/console/Resources/completion.bash | 9 +- .../console/SignalRegistry/SignalRegistry.php | 2 +- .../symfony/console/Style/SymfonyStyle.php | 6 +- .../vendor/symfony/console/Terminal.php | 17 +- .../console/Tester/ApplicationTester.php | 38 +- .../symfony/console/Tester/TesterTrait.php | 8 +- .../vendor/symfony/console/composer.json | 2 +- .../symfony/deprecation-contracts/LICENSE | 2 +- .../event-dispatcher-contracts/LICENSE | 2 +- .../Debug/TraceableEventDispatcher.php | 6 +- .../Debug/WrappedListener.php | 12 +- .../RegisterListenersPass.php | 10 +- .../event-dispatcher/EventDispatcher.php | 4 +- .../vendor/symfony/event-dispatcher/LICENSE | 2 +- .../vendor/symfony/filesystem/Filesystem.php | 27 +- .../vendor/symfony/filesystem/LICENSE | 2 +- .../vendor/symfony/filesystem/Path.php | 72 +- .../vendor/symfony/polyfill-ctype/LICENSE | 2 +- .../vendor/symfony/polyfill-ctype/README.md | 2 +- .../symfony/polyfill-ctype/composer.json | 2 +- .../polyfill-intl-grapheme/Grapheme.php | 2 +- .../symfony/polyfill-intl-grapheme/LICENSE | 2 +- .../symfony/polyfill-intl-grapheme/README.md | 2 +- .../polyfill-intl-grapheme/composer.json | 2 +- .../symfony/polyfill-intl-normalizer/LICENSE | 2 +- .../polyfill-intl-normalizer/Normalizer.php | 2 +- .../polyfill-intl-normalizer/README.md | 2 +- .../polyfill-intl-normalizer/composer.json | 2 +- .../vendor/symfony/polyfill-mbstring/LICENSE | 2 +- .../symfony/polyfill-mbstring/Mbstring.php | 148 +- .../symfony/polyfill-mbstring/README.md | 2 +- .../Resources/unidata/caseFolding.php | 119 ++ .../symfony/polyfill-mbstring/bootstrap.php | 4 + .../symfony/polyfill-mbstring/bootstrap80.php | 4 + .../symfony/polyfill-mbstring/composer.json | 2 +- .../vendor/symfony/polyfill-php73/LICENSE | 2 +- .../vendor/symfony/polyfill-php73/README.md | 2 +- .../symfony/polyfill-php73/composer.json | 2 +- .../vendor/symfony/polyfill-php80/LICENSE | 2 +- .../vendor/symfony/polyfill-php80/README.md | 7 +- .../Resources/stubs/Attribute.php | 9 + .../Resources/stubs/PhpToken.php | 11 +- .../Resources/stubs/Stringable.php | 9 + .../Resources/stubs/UnhandledMatchError.php | 9 + .../Resources/stubs/ValueError.php | 9 + .../symfony/polyfill-php80/composer.json | 2 +- .../vendor/symfony/polyfill-php81/LICENSE | 2 +- .../vendor/symfony/polyfill-php81/README.md | 6 +- .../Resources/stubs/CURLStringFile.php | 51 + .../Resources/stubs/ReturnTypeWillChange.php | 9 + .../symfony/polyfill-php81/composer.json | 2 +- .../vendor/symfony/string/AbstractString.php | 2 +- .../symfony/string/AbstractUnicodeString.php | 17 +- .../vendor/symfony/string/ByteString.php | 7 +- .../string/Inflector/EnglishInflector.php | 15 + .../string/Inflector/FrenchInflector.php | 4 +- .../integration/vendor/symfony/string/LICENSE | 2 +- .../vendor/symfony/string/LazyString.php | 4 +- .../Resources/data/wcswidth_table_wide.php | 48 +- .../Resources/data/wcswidth_table_zero.php | 46 +- .../symfony/translation-contracts/LICENSE | 2 +- .../Test/TranslatorTest.php | 2 +- .../vendor/symfony/translation/CHANGELOG.md | 7 + .../Command/TranslationPullCommand.php | 4 +- .../Command/TranslationPushCommand.php | 7 + .../TranslatorPathsPass.php | 29 +- .../translation/Dumper/IcuResFileDumper.php | 4 +- .../translation/Dumper/MoFileDumper.php | 2 +- .../vendor/symfony/translation/LICENSE | 2 +- .../translation/Loader/ArrayLoader.php | 6 +- .../translation/Loader/IcuResFileLoader.php | 2 +- .../translation/Loader/PhpFileLoader.php | 2 +- .../symfony/translation/MessageCatalogue.php | 19 +- .../translation/MessageCatalogueInterface.php | 2 +- .../PseudoLocalizationTranslator.php | 2 +- .../Resources/bin/translation-status.php | 4 + .../translation/Resources/data/parents.json | 3 + .../Test/ProviderFactoryTestCase.php | 10 +- .../translation/Test/ProviderTestCase.php | 6 +- .../symfony/translation/TranslatorBag.php | 7 +- .../vendor/symfony/yaml/Dumper.php | 50 +- .../vendor/symfony/yaml/Inline.php | 11 +- tests/integration/vendor/symfony/yaml/LICENSE | 2 +- .../vendor/symfony/yaml/Parser.php | 10 +- .../symfony/yaml/Resources/bin/yaml-lint | 4 + 304 files changed, 5262 insertions(+), 2453 deletions(-) delete mode 100644 .drone.yml create mode 100644 .github/workflows/integration.yml create mode 100644 tests/integration/data/98nextcloud-schema.ldif create mode 100644 tests/integration/data/entries.ldif delete mode 100644 tests/integration/vendor/guzzlehttp/promises/Makefile delete mode 100644 tests/integration/vendor/guzzlehttp/promises/src/functions.php delete mode 100644 tests/integration/vendor/guzzlehttp/promises/src/functions_include.php create mode 100644 tests/integration/vendor/guzzlehttp/psr7/src/UriComparator.php delete mode 100644 tests/integration/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json delete mode 100644 tests/integration/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json delete mode 100644 tests/integration/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json delete mode 100644 tests/integration/vendor/psr/http-factory/.gitignore delete mode 100644 tests/integration/vendor/psr/http-factory/.pullapprove.yml create mode 100644 tests/integration/vendor/psr/http-message/docs/PSR7-Interfaces.md create mode 100644 tests/integration/vendor/psr/http-message/docs/PSR7-Usage.md create mode 100644 tests/integration/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php create mode 100644 tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 5bc95f37f..000000000 --- a/.drone.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -kind: pipeline -name: integration-tests-master - -clone: - depth: 1 - -steps: - - name: integration-tests-master - image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-php8.0:latest - environment: - CORE_BRANCH: master - commands: - - /start.sh - - /wait-for-services.sh - - rm -rf /var/www/html - - cd /var/www/ - - git clone --depth 1 -b $CORE_BRANCH https://github.com/nextcloud/server html - - cd /var/www/html && git submodule update --init - # use local clone - - cp -r /drone/src /var/www/html/apps/user_saml - - php /var/www/html/occ maintenance:install --database sqlite --admin-pass password - - php /var/www/html/occ app:enable user_saml - - chown -R apache:apache /var/www/html/ - - cd /var/www/html/apps/user_saml/tests/integration && vendor/bin/behat - -trigger: - branch: - - master - - stable* - event: - - pull_request - - push - -type: docker - ---- -kind: signature -hmac: 6ca48f8c8e9ea9cc6dcc01f8d18193156a2f8b41f94ddf5fa8e74534fa08dbd8 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 000000000..4c181d990 --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,138 @@ +name: Integration tests + +on: + pull_request: + paths: + - '.github/workflows/integration.yml' + - 'appinfo/**' + - 'lib/**' + - 'tests/**' + - 'composer.*' + push: + branches: + - main + - master + - stable* + +env: + APP_NAME: user_saml + LDAP_SUFFIX: dc=idptestbed + LDAP_CR_NAME: directory + +jobs: + integration: + runs-on: self-hosted + + strategy: + fail-fast: false + matrix: + php-versions: [ "8.0" ] + databases: [ "sqlite" ] + server-versions: [ "master" ] + + + name: Integration php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }} + + #container: ubuntu + + services: + directory: + image: quay.io/389ds/dirsrv:latest + ports: + - 389:3389/tcp + env: + DS_DM_PASSWORD: admin + DS_SUFFIX_NAME: dc=idptestbed + options: + --name directory + sso: + image: ghcr.io/nextcloud/continuous-integration-user_saml_shibboleth-idp:latest + ports: + - 4443:8443/tcp + - 9090:8080/tcp + + steps: + #- name: Install utilities + #run: | + #sudo apt update -y + #sudo apt install -y git docker.io curl + + #- name: Test sso container + #run: curl 'https://localhost:4443/idp/profile/SAML2/Redirect/SSO?SAMLRequest=nZJbj9MwEIXf%2BytWeW%2BduOnNaiuVLZdKpa2awgMvq6kzoZYc23gcWP49TgK7gMQ%2BMJYseezzac6RlwS1dmLThJs545cGKQzuYj3W2pDoLldJ442wQIqEgRpJBCmKzfu94KNUOG%2BDlVYnf8leVgER%2BqCs6WW77So5Hl7vj293hwd%2BzasK8mwOc15Opnk5wSpf5LOx5ItJCrzKJsBheu2lH9FT5KySiE0GPY2owZ2hACbEfsrHw3QxzLJLNhV8Jvj4Uy%2FdRrPKQOjktxAcCcYyPhulcWUiz%2FMxU6Vj0WKlNLJ2es7OWCqPMrCiOPac088IXilTKvP5ZefX%2FhGJd5fLaXg6FpcesvmVyL011NToC%2FRflcQP530%2FXJxNWwn6ZimIeTpPWSTh48jdHAPniDUR8NBGz7oNJCXrDr1sz6JLxa%2F%2FB1VjgBICLNnvpGe2E4foc7c9Wa3k967f1hvrawj%2FjiOLIbcdVQ6r7qloDDmUqlJYJk%2BYjdb2271HCLhKgm8wuWPrQT%2FLnz93%2FQM%3D&RelayState=http%3A%2F%2Flocalhost%3A8080%2Findex.php%2Fapps%2Fuser_saml%2Fsaml%2Flogin&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=ZsTglbAjFrUgyBsUcm1cMOyHV7rzXTr9YM4E38fXiS1mXT5HNfy%2BR4ho6DCYXAuCmcYQwzJ8EiMAFYAHdUQZt8EkCHcV10qvL2hKhkMMxkvRL2%2FYPSdrvit8VfSpwgbOYrZOAu4re5JDU%2F5CWJ2tZpRYfokA0gldS%2BFuodqETGqRthZB9ge7oTmQUUbH7RxlmU8UCiwfWc0RtUNC4P%2FrsVwDS9bUgAzrqOqs7KOoCnrJPn08Fdz2RmoxJapdmBt9BAHxeDce5RPo%2BIoI5c8JDIPcUEuhImWJFXJnoQRIkJLYIIfgoqoj%2Bgtc6Np1%2BOeHJBSzlATZqiOWUIInfarjBg%3D%3D' || sleep 20 + + - name: Initialize LDAP Service + shell: bash + run: | + CONTAINER_NAME=directory + # Initialize LDAP Database. May wait until server is ready. + while : ; do + sleep 1 + if docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend create --suffix "${{ env.LDAP_SUFFIX }}" --be-name ci_root; then + break; + fi + if [ $(docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend suffix list | grep "${{ env.LDAP_SUFFIX }}" | wc -l) -eq 1 ]; then + break + fi + done + # Add custom schema + docker cp apps/${{ env.APP_NAME }}/tests/integration/data/98nextcloud-schema.ldif ${{ env.LDAP_CR_NAME }}:/etc/dirsrv/slapd-localhost/schema/ + docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost schema reload + # Add test entries + docker cp apps/${{ env.APP_NAME }}/tests/integration/data/entries.ldif ${{ env.LDAP_CR_NAME }}:/var/opt/ + docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend import "${{ env.LDAP_SUFFIX }}" /var/opt/entries.ldif + date + + - name: Checkout server + uses: actions/checkout@v3 + with: + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + submodules: true + + - name: Checkout app + uses: actions/checkout@v3 + with: + path: apps/${{ env.APP_NAME }} + + - name: Set up php ${{ matrix.php-versions }} + uses: shivammathur/setup-php@72ae4ccbe57f82bbe08411e84e2130bd4ba1c10f # v2 + with: + php-version: ${{ matrix.php-versions }} + # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation + extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite + coverage: none + ini-file: development + ini-values: disabled_functions= + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: DEBUG diagnose PHP modules + run: | + echo 'extension=pcntl.so' | sudo tee /etc/php/${{ matrix.php-versions }}/fpm/conf.d/10-pcntl.ini + php -m + + - name: Set up dependencies + working-directory: apps/${{ env.APP_NAME }} + run: composer i --no-dev + + - name: Set up Nextcloud + run: | + if [ "${{ matrix.databases }}" = "mysql" ]; then + export DB_PORT=4444 + elif [ "${{ matrix.databases }}" = "pgsql" ]; then + export DB_PORT=4445 + fi + mkdir data + ./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin + ./occ app:enable --force ${{ env.APP_NAME }} + PHP_CLI_SERVER_WORKERS=4 php -S localhost:8080 & + + - name: Run behat + working-directory: apps/${{ env.APP_NAME }}/tests/integration + run: | + composer install + ./vendor/bin/behat --colors + + - name: Dump nextcloud.log + if: always() + run: cat data/nextcloud.log diff --git a/tests/integration/composer.json b/tests/integration/composer.json index 7836cce7f..1fb64ff1c 100644 --- a/tests/integration/composer.json +++ b/tests/integration/composer.json @@ -1,6 +1,11 @@ { + "config": { + "platform": { + "php": "8.0" + } + }, "require": { - "php": ">=7.3" + "php": ">=8.0" }, "require-dev": { "behat/behat": "^3.3", diff --git a/tests/integration/composer.lock b/tests/integration/composer.lock index 7e7e654e2..71b3675d9 100644 --- a/tests/integration/composer.lock +++ b/tests/integration/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": "9ff9f72d6a7cf43bebb439d1db2825a4", + "content-hash": "0790f547feacc83c12ade22c943855c3", "packages": [], "packages-dev": [ { @@ -208,22 +208,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -314,7 +314,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.7.0" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -330,20 +330,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/3a494dc7dc1d7d12e511890177ae2d0e6c107da6", - "reference": "3a494dc7dc1d7d12e511890177ae2d0e6c107da6", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { @@ -397,7 +397,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.0" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -413,20 +413,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T13:50:22+00:00" + "time": "2023-08-03T15:11:55+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": { @@ -513,7 +513,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": [ { @@ -529,7 +529,7 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "psr/container", @@ -636,16 +636,16 @@ }, { "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": { @@ -682,9 +682,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", @@ -840,16 +840,16 @@ }, { "name": "symfony/config", - "version": "v5.4.21", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4" + "reference": "8109892f27beed9252bd1f1c1880aeb4ad842650" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/2a6b1111d038adfa15d52c0871e540f3b352d1e4", - "reference": "2a6b1111d038adfa15d52c0871e540f3b352d1e4", + "url": "https://api.github.com/repos/symfony/config/zipball/8109892f27beed9252bd1f1c1880aeb4ad842650", + "reference": "8109892f27beed9252bd1f1c1880aeb4ad842650", "shasum": "" }, "require": { @@ -899,7 +899,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.21" + "source": "https://github.com/symfony/config/tree/v5.4.26" }, "funding": [ { @@ -915,20 +915,20 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2023-07-19T20:21:11+00:00" }, { "name": "symfony/console", - "version": "v5.4.23", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -998,7 +998,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.23" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -1014,7 +1014,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T18:47:29+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/dependency-injection", @@ -1172,16 +1172,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "1df20e45d56da29a4b1d8259dd6e950acbf1b13f" + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1df20e45d56da29a4b1d8259dd6e950acbf1b13f", - "reference": "1df20e45d56da29a4b1d8259dd6e950acbf1b13f", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac", + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac", "shasum": "" }, "require": { @@ -1237,7 +1237,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.22" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26" }, "funding": [ { @@ -1253,7 +1253,7 @@ "type": "tidelift" } ], - "time": "2023-03-17T11:31:58+00:00" + "time": "2023-07-06T06:34:20+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -1336,16 +1336,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -1380,7 +1380,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.23" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -1396,20 +1396,20 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1424,7 +1424,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1462,7 +1462,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1478,20 +1478,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1503,7 +1503,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1543,7 +1543,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1559,20 +1559,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1584,7 +1584,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1627,7 +1627,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1643,20 +1643,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1671,7 +1671,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1710,7 +1710,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1726,20 +1726,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -1748,7 +1748,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1789,7 +1789,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -1805,20 +1805,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1827,7 +1827,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1872,7 +1872,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1888,20 +1888,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", - "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { @@ -1910,7 +1910,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1951,7 +1951,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -1967,7 +1967,7 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", @@ -2050,16 +2050,16 @@ }, { "name": "symfony/string", - "version": "v5.4.22", + "version": "v5.4.26", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", - "reference": "8036a4c76c0dd29e60b6a7cafcacc50cf088ea62", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -2116,7 +2116,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.22" + "source": "https://github.com/symfony/string/tree/v5.4.26" }, "funding": [ { @@ -2132,20 +2132,20 @@ "type": "tidelift" } ], - "time": "2023-03-14T06:11:53+00:00" + "time": "2023-06-28T12:46:07+00:00" }, { "name": "symfony/translation", - "version": "v5.4.22", + "version": "v5.4.24", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "9a401392f01bc385aa42760eff481d213a0cc2ba" + "reference": "de237e59c5833422342be67402d487fbf50334ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/9a401392f01bc385aa42760eff481d213a0cc2ba", - "reference": "9a401392f01bc385aa42760eff481d213a0cc2ba", + "url": "https://api.github.com/repos/symfony/translation/zipball/de237e59c5833422342be67402d487fbf50334ff", + "reference": "de237e59c5833422342be67402d487fbf50334ff", "shasum": "" }, "require": { @@ -2213,7 +2213,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.22" + "source": "https://github.com/symfony/translation/tree/v5.4.24" }, "funding": [ { @@ -2229,7 +2229,7 @@ "type": "tidelift" } ], - "time": "2023-03-27T16:07:23+00:00" + "time": "2023-05-19T12:34:17+00:00" }, { "name": "symfony/translation-contracts", @@ -2391,8 +2391,11 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.3" + "php": ">=8.0" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform-overrides": { + "php": "8.0" + }, + "plugin-api-version": "2.6.0" } diff --git a/tests/integration/data/98nextcloud-schema.ldif b/tests/integration/data/98nextcloud-schema.ldif new file mode 100644 index 000000000..12114945a --- /dev/null +++ b/tests/integration/data/98nextcloud-schema.ldif @@ -0,0 +1,13 @@ +dn: cn=schema +objectClass: top +objectClass: ldapSubentry +objectClass: subschema +cn: schema +aci: (target="ldap:///cn=schema")(targetattr !="aci")(version 3.0;acl "anonymous, no acis"; allow (read, search, compare) userdn = "ldap:///anyone";) +modifiersName: cn=Directory Manager +modifyTimestamp: 20230412120423Z +objectClasses: ( 1.3.6.1.4.1.49213.1.2.1 NAME 'nextcloudUser' AUXILIARY MUST cn MAY (nextcloudEnabled $ nextcloudQuota ) X-ORIGIN 'user defined' ) +objectClasses: ( 1.3.6.1.4.1.49213.1.2.2 NAME 'nextcloudGroup' AUXILIARY MUST cn MAY nextcloudEnabled X-ORIGIN 'user defined' ) +attributeTypes: ( 1.3.6.1.4.1.49213.1.1.1 NAME 'nextcloudEnabled' DESC 'whether user or group should be available in Nextcloud' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'user defined' ) +attributeTypes: ( 1.3.6.1.4.1.49213.1.1.2 NAME 'nextcloudQuota' DESC 'defines how much disk space is available for the user (e.g. 2 GB)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' ) +nsSchemaCSN: 64369e47000000000000 diff --git a/tests/integration/data/entries.ldif b/tests/integration/data/entries.ldif new file mode 100644 index 000000000..6d5832ef2 --- /dev/null +++ b/tests/integration/data/entries.ldif @@ -0,0 +1,64 @@ + +dn: dc=idptestbed +objectClass: top +objectClass: domain +dc: idptestbed +description: dc=idptestbed + +dn: cn=admin,dc=idptestbed +objectClass: simpleSecurityObject +objectClass: organizationalRole +cn: admin +userPassword: password +description: LDAP administrator + +dn: ou=Groups,dc=idptestbed +objectClass: top +objectClass: organizationalunit +ou: Groups + +dn: ou=People,dc=idptestbed +objectClass: top +objectClass: organizationalunit +ou: People + +dn: uid=student1,ou=People,dc=idptestbed +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: inetOrgPerson +objectClass: nextcloudUser +givenName: Stud +uid: student1 +sn: Ent +cn: Stud Ent +mail: student1@idptestbed.edu +userPassword: password +nextcloudQuota: 200 MB + +dn: uid=student2,ou=People,dc=idptestbed +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: inetOrgPerson +objectClass: nextcloudUser +givenName: Stud +uid: student2 +sn: Ent2 +cn: Stud Ent2 +mail: student2@idptestbed.edu +userPassword: password +nextcloudQuota: 1 GB + +dn: uid=staff1,ou=People,dc=idptestbed +objectClass: organizationalPerson +objectClass: person +objectClass: top +objectClass: inetOrgPerson +objectClass: nextcloudUser +givenName: St +uid: staff1 +sn: aff +cn: St aff +mail: staff1@idptestbed.edu +userPassword: password diff --git a/tests/integration/features/EnvironmentVariable.feature b/tests/integration/features/EnvironmentVariable.feature index b10957717..ceb84f3bf 100644 --- a/tests/integration/features/EnvironmentVariable.feature +++ b/tests/integration/features/EnvironmentVariable.feature @@ -4,8 +4,8 @@ Feature: EnvironmentVariable And The setting "type" is set to "environment-variable" And The setting "general-uid_mapping" is set to "REMOTE_USER" And The environment variable "REMOTE_USER" is set to "not-provisioned-user" - When I send a GET request to "http://localhost/index.php/login" - Then I should be redirected to "http://localhost/index.php/apps/dashboard/" + When I send a GET request to "http://localhost:8080/index.php/login" + Then I should be redirected to "http://localhost:8080/index.php/apps/dashboard/" Then The user value "id" should be "not-provisioned-user" And The last login timestamp of "not-provisioned-user" should not be empty @@ -15,8 +15,8 @@ Feature: EnvironmentVariable And The setting "general-require_provisioned_account" is set to "1" And The setting "general-uid_mapping" is set to "REMOTE_USER" And The environment variable "REMOTE_USER" is set to "provisioned-user" - When I send a GET request to "http://localhost/index.php/login" - Then I should be redirected to "http://localhost/index.php/apps/dashboard/" + When I send a GET request to "http://localhost:8080/index.php/login" + Then I should be redirected to "http://localhost:8080/index.php/apps/dashboard/" Then The user value "id" should be "provisioned-user" And The last login timestamp of "provisioned-user" should not be empty @@ -25,5 +25,5 @@ Feature: EnvironmentVariable And The setting "general-require_provisioned_account" is set to "1" And The setting "general-uid_mapping" is set to "REMOTE_USER" And The environment variable "REMOTE_USER" is set to "certainly-not-provisioned-user" - When I send a GET request to "http://localhost/index.php/login" - Then I should be redirected to "http://localhost/index.php/apps/user_saml/saml/notProvisioned" + When I send a GET request to "http://localhost:8080/index.php/login" + Then I should be redirected to "http://localhost:8080/index.php/apps/user_saml/saml/notProvisioned" diff --git a/tests/integration/features/Shibboleth.feature b/tests/integration/features/Shibboleth.feature index ab0636daf..11c8e8d84 100644 --- a/tests/integration/features/Shibboleth.feature +++ b/tests/integration/features/Shibboleth.feature @@ -11,13 +11,13 @@ Feature: Shibboleth And The setting "sp-x509cert" is set to "-----BEGIN CERTIFICATE-----MIIC+zCCAeOgAwIBAgIJAIgZuvWDBIrdMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNzAxMDQxMTM5MjFaFw0yNzAxMDIxMTM5MjFaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN3ESWaDH1JiJTy9yRJQV7kahPOxgBkIH2xwcYDL1k9deKNhSKLx7aGfxE244+HBcC6WLHKVUnOm0ld2qxQ4bMYiJXzZuqL67r07L5wxGAssv12lO92qohGmlHy3+VzRYUBmovu6upqOv3R2F8HBbo7Jc7Hvt7hOEJn/jPuFuF/fHit3mqU8l6IkrIZjpaW8T9fIWOXRq98U4+hkgWpqEZWsqlfE8BxAs9DeIMZab0GxO9stHLp+GYKx10uE4ezFcaDS8W+g2C8enCTt1HXGvcnj4o5zkC1lITGvcFTsiFqfIWyXeSufcxdc0W7HoG6J3ks0WJyK38sfFn0t2Ao6kX0CAwEAAaNQME4wHQYDVR0OBBYEFAoJzX6TVYAwC1GSPe6nObBG54zaMB8GA1UdIwQYMBaAFAoJzX6TVYAwC1GSPe6nObBG54zaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAJia9R70uXdUZtgujUPjLas4+sVajzlBFmqhBqpLAo934vljf9HISsHrPtdBcbS0d0rucqXwabDf0MlR18ksnT/NYpsTwMbMx76CrXi4zYEEW5lISKEO65aIkzVTcqKWSuhjtSnRdB6iOLsFiKmNMWXaIKMR5T0+AbR9wdQgn08W+3EEeHGvafVQfE3STVsSgNb1ft7DvcSUnfPXGU7KzvmTpZa0Hfmc7uY4vpdEEhLAdRhgLReS7USZskov7ooiPSoD+JRFi2gM4klBxTemHdNUa9oFnHMXuYKOkLbkgFvHxyy+QlLq2ELQTga5e7I83ZyOfGctyf8Ul6vGw10vbQ=-----END CERTIFICATE-----" And The setting "sp-privateKey" is set to "-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEA3cRJZoMfUmIlPL3JElBXuRqE87GAGQgfbHBxgMvWT114o2FIovHtoZ/ETbjj4cFwLpYscpVSc6bSV3arFDhsxiIlfNm6ovruvTsvnDEYCyy/XaU73aqiEaaUfLf5XNFhQGai+7q6mo6/dHYXwcFujslzse+3uE4Qmf+M+4W4X98eK3eapTyXoiSshmOlpbxP18hY5dGr3xTj6GSBamoRlayqV8TwHECz0N4gxlpvQbE72y0cun4ZgrHXS4Th7MVxoNLxb6DYLx6cJO3Udca9yePijnOQLWUhMa9wVOyIWp8hbJd5K59zF1zRbsegboneSzRYnIrfyx8WfS3YCjqRfQIDAQABAoIBAQC5CQAdcqZ9vLpJNilBCJxJLCFmm+HAAREHD8MErg9A5UK1P4S1wJp/0qieGPi68wXBOTgY2xKSwMycgb04/+NyZidVRu388takOW/+KNBg8pMxdZ6/05GqnI0kivSbR3CXpYuz8hekwhpo9+fWmKjApsHL47ItK6WaeKmPbAFsq1YJGzfp/DXg7LIvh9GA3C1LWWGV7SuCGOyX/2Moi8xRa7qBtH4hDo/0NRhTx7zjYjlBgNEr330pJUopc3+AtHE40R+xMr2zkGvq9RsCZxYxD2VWbLwQW0yNjWmQ2OTuMgJJvk2+N73QLHcB+tea82ZTszsNzRS9DLtc6qbsKEPZAoGBAO78U3vEuRyY56f/1hpo0xuCDwOkWGzgBQWkjJl6dlyVz/zKkhXBHpEYImyt8XRN0W3iGZYpZ2hCFJGTcDp32R6UiEyGLz0Uc8R/tva/TiRVW1FdNczzSHcB24b9OMK4vE9JLs8mA8Rp8YBgtLr5DDuMfYt/a/rZJbg/HIfIN98nAoGBAO2OInCX93t2I6zzRPIqKtI6q6FYNp64VIQjvw9Y8l0x3IdJZRP9H5C8ZhCeYPsgEqTXcXa4j5hL4rQzoUtxfxflBUUH60bcnd4LGaTCMYLS14G011E3GZlIP0sJi5OjEhy8fq3zt6jVzS9V/lPHB8i+w1D7CbPrMpW7B3k32vC7AoGAX/HvdkYhZyjAAEOG6m1hK68IZhbp5TP+8CgCxm9S65K9wKh3A8LXibrdvzIKOP4w8WOPkCipOkMlTNibeu24vj01hztr5aK7Y40+oEtnjNCz67N3MQQO+LBHOSeaTRqrh01DPKjvZECAU2D/zfzEe3fIw2Nxr3DUYub7hkvMmosCgYAzxbVVypjiLGYsDDyrdmsstCKxoDMPNmcdAVljc+QmUXaZeXJw/8qAVb78wjeqo1vM1zNgR2rsKyW2VkZB1fN39q7GU6qAIBa7zLmDAduegmr7VrlSduq6UFeS9/qWa4TIBICrUqFlR2tXdKtgANF+e6y/mmaL8qdsoH1JetXZfwKBgQC1vscRpdAXivjOOZAh+mzJWzS4BUl4CTJLYYIuOEXikmN5g0EdV2fhUEdkewmyKnXHsd0x83167bYgpTDNs71jUxDHy5NXlg2qIjLkf09X9wr19gBzDApfWzfh3vUqttyMZuQMLVNepGCWM2vjlY9KGl5OvZqY6d+7yO0mLV9GmQ==-----END RSA PRIVATE KEY-----" And The setting "security-wantAssertionsSigned" is set to "1" - When I send a GET request to "http://localhost/index.php/login" + When I send a GET request to "http://localhost:8080/index.php/login" Then I should be redirected to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO" And I send a POST request to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO?execution=e1s1" with the following data |j_username|j_password|_eventId_proceed| |student1 |password | | And The response should be a SAML redirect page that gets submitted - And I should be redirected to "http://localhost/index.php/apps/dashboard/" + And I should be redirected to "http://localhost:8080/index.php/apps/dashboard/" And The user value "id" should be "student1" And The last login timestamp of "student1" should not be empty @@ -33,13 +33,13 @@ Feature: Shibboleth And The setting "sp-x509cert" is set to "-----BEGIN CERTIFICATE-----MIIC+zCCAeOgAwIBAgIJAIgZuvWDBIrdMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNzAxMDQxMTM5MjFaFw0yNzAxMDIxMTM5MjFaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN3ESWaDH1JiJTy9yRJQV7kahPOxgBkIH2xwcYDL1k9deKNhSKLx7aGfxE244+HBcC6WLHKVUnOm0ld2qxQ4bMYiJXzZuqL67r07L5wxGAssv12lO92qohGmlHy3+VzRYUBmovu6upqOv3R2F8HBbo7Jc7Hvt7hOEJn/jPuFuF/fHit3mqU8l6IkrIZjpaW8T9fIWOXRq98U4+hkgWpqEZWsqlfE8BxAs9DeIMZab0GxO9stHLp+GYKx10uE4ezFcaDS8W+g2C8enCTt1HXGvcnj4o5zkC1lITGvcFTsiFqfIWyXeSufcxdc0W7HoG6J3ks0WJyK38sfFn0t2Ao6kX0CAwEAAaNQME4wHQYDVR0OBBYEFAoJzX6TVYAwC1GSPe6nObBG54zaMB8GA1UdIwQYMBaAFAoJzX6TVYAwC1GSPe6nObBG54zaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAJia9R70uXdUZtgujUPjLas4+sVajzlBFmqhBqpLAo934vljf9HISsHrPtdBcbS0d0rucqXwabDf0MlR18ksnT/NYpsTwMbMx76CrXi4zYEEW5lISKEO65aIkzVTcqKWSuhjtSnRdB6iOLsFiKmNMWXaIKMR5T0+AbR9wdQgn08W+3EEeHGvafVQfE3STVsSgNb1ft7DvcSUnfPXGU7KzvmTpZa0Hfmc7uY4vpdEEhLAdRhgLReS7USZskov7ooiPSoD+JRFi2gM4klBxTemHdNUa9oFnHMXuYKOkLbkgFvHxyy+QlLq2ELQTga5e7I83ZyOfGctyf8Ul6vGw10vbQ=-----END CERTIFICATE-----" And The setting "sp-privateKey" is set to "-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEA3cRJZoMfUmIlPL3JElBXuRqE87GAGQgfbHBxgMvWT114o2FIovHtoZ/ETbjj4cFwLpYscpVSc6bSV3arFDhsxiIlfNm6ovruvTsvnDEYCyy/XaU73aqiEaaUfLf5XNFhQGai+7q6mo6/dHYXwcFujslzse+3uE4Qmf+M+4W4X98eK3eapTyXoiSshmOlpbxP18hY5dGr3xTj6GSBamoRlayqV8TwHECz0N4gxlpvQbE72y0cun4ZgrHXS4Th7MVxoNLxb6DYLx6cJO3Udca9yePijnOQLWUhMa9wVOyIWp8hbJd5K59zF1zRbsegboneSzRYnIrfyx8WfS3YCjqRfQIDAQABAoIBAQC5CQAdcqZ9vLpJNilBCJxJLCFmm+HAAREHD8MErg9A5UK1P4S1wJp/0qieGPi68wXBOTgY2xKSwMycgb04/+NyZidVRu388takOW/+KNBg8pMxdZ6/05GqnI0kivSbR3CXpYuz8hekwhpo9+fWmKjApsHL47ItK6WaeKmPbAFsq1YJGzfp/DXg7LIvh9GA3C1LWWGV7SuCGOyX/2Moi8xRa7qBtH4hDo/0NRhTx7zjYjlBgNEr330pJUopc3+AtHE40R+xMr2zkGvq9RsCZxYxD2VWbLwQW0yNjWmQ2OTuMgJJvk2+N73QLHcB+tea82ZTszsNzRS9DLtc6qbsKEPZAoGBAO78U3vEuRyY56f/1hpo0xuCDwOkWGzgBQWkjJl6dlyVz/zKkhXBHpEYImyt8XRN0W3iGZYpZ2hCFJGTcDp32R6UiEyGLz0Uc8R/tva/TiRVW1FdNczzSHcB24b9OMK4vE9JLs8mA8Rp8YBgtLr5DDuMfYt/a/rZJbg/HIfIN98nAoGBAO2OInCX93t2I6zzRPIqKtI6q6FYNp64VIQjvw9Y8l0x3IdJZRP9H5C8ZhCeYPsgEqTXcXa4j5hL4rQzoUtxfxflBUUH60bcnd4LGaTCMYLS14G011E3GZlIP0sJi5OjEhy8fq3zt6jVzS9V/lPHB8i+w1D7CbPrMpW7B3k32vC7AoGAX/HvdkYhZyjAAEOG6m1hK68IZhbp5TP+8CgCxm9S65K9wKh3A8LXibrdvzIKOP4w8WOPkCipOkMlTNibeu24vj01hztr5aK7Y40+oEtnjNCz67N3MQQO+LBHOSeaTRqrh01DPKjvZECAU2D/zfzEe3fIw2Nxr3DUYub7hkvMmosCgYAzxbVVypjiLGYsDDyrdmsstCKxoDMPNmcdAVljc+QmUXaZeXJw/8qAVb78wjeqo1vM1zNgR2rsKyW2VkZB1fN39q7GU6qAIBa7zLmDAduegmr7VrlSduq6UFeS9/qWa4TIBICrUqFlR2tXdKtgANF+e6y/mmaL8qdsoH1JetXZfwKBgQC1vscRpdAXivjOOZAh+mzJWzS4BUl4CTJLYYIuOEXikmN5g0EdV2fhUEdkewmyKnXHsd0x83167bYgpTDNs71jUxDHy5NXlg2qIjLkf09X9wr19gBzDApfWzfh3vUqttyMZuQMLVNepGCWM2vjlY9KGl5OvZqY6d+7yO0mLV9GmQ==-----END RSA PRIVATE KEY-----" And The setting "security-wantAssertionsSigned" is set to "1" - When I send a GET request to "http://localhost/index.php/login" + When I send a GET request to "http://localhost:8080/index.php/login" Then I should be redirected to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO" And I send a POST request to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO?execution=e1s1" with the following data |j_username|j_password|_eventId_proceed| |student1 |password | | And The response should be a SAML redirect page that gets submitted - And I should be redirected to "http://localhost/index.php/apps/user_saml/saml/notProvisioned" + And I should be redirected to "http://localhost:8080/index.php/apps/user_saml/saml/notProvisioned" Scenario: Authenticating using Shibboleth with SAML and check if user exists on backend and existing user Given A local user with uid "student1" exists @@ -55,13 +55,13 @@ Feature: Shibboleth And The setting "sp-x509cert" is set to "-----BEGIN CERTIFICATE-----MIIC+zCCAeOgAwIBAgIJAIgZuvWDBIrdMA0GCSqGSIb3DQEBBQUAMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xNzAxMDQxMTM5MjFaFw0yNzAxMDIxMTM5MjFaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN3ESWaDH1JiJTy9yRJQV7kahPOxgBkIH2xwcYDL1k9deKNhSKLx7aGfxE244+HBcC6WLHKVUnOm0ld2qxQ4bMYiJXzZuqL67r07L5wxGAssv12lO92qohGmlHy3+VzRYUBmovu6upqOv3R2F8HBbo7Jc7Hvt7hOEJn/jPuFuF/fHit3mqU8l6IkrIZjpaW8T9fIWOXRq98U4+hkgWpqEZWsqlfE8BxAs9DeIMZab0GxO9stHLp+GYKx10uE4ezFcaDS8W+g2C8enCTt1HXGvcnj4o5zkC1lITGvcFTsiFqfIWyXeSufcxdc0W7HoG6J3ks0WJyK38sfFn0t2Ao6kX0CAwEAAaNQME4wHQYDVR0OBBYEFAoJzX6TVYAwC1GSPe6nObBG54zaMB8GA1UdIwQYMBaAFAoJzX6TVYAwC1GSPe6nObBG54zaMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAJia9R70uXdUZtgujUPjLas4+sVajzlBFmqhBqpLAo934vljf9HISsHrPtdBcbS0d0rucqXwabDf0MlR18ksnT/NYpsTwMbMx76CrXi4zYEEW5lISKEO65aIkzVTcqKWSuhjtSnRdB6iOLsFiKmNMWXaIKMR5T0+AbR9wdQgn08W+3EEeHGvafVQfE3STVsSgNb1ft7DvcSUnfPXGU7KzvmTpZa0Hfmc7uY4vpdEEhLAdRhgLReS7USZskov7ooiPSoD+JRFi2gM4klBxTemHdNUa9oFnHMXuYKOkLbkgFvHxyy+QlLq2ELQTga5e7I83ZyOfGctyf8Ul6vGw10vbQ=-----END CERTIFICATE-----" And The setting "sp-privateKey" is set to "-----BEGIN RSA PRIVATE KEY-----MIIEpAIBAAKCAQEA3cRJZoMfUmIlPL3JElBXuRqE87GAGQgfbHBxgMvWT114o2FIovHtoZ/ETbjj4cFwLpYscpVSc6bSV3arFDhsxiIlfNm6ovruvTsvnDEYCyy/XaU73aqiEaaUfLf5XNFhQGai+7q6mo6/dHYXwcFujslzse+3uE4Qmf+M+4W4X98eK3eapTyXoiSshmOlpbxP18hY5dGr3xTj6GSBamoRlayqV8TwHECz0N4gxlpvQbE72y0cun4ZgrHXS4Th7MVxoNLxb6DYLx6cJO3Udca9yePijnOQLWUhMa9wVOyIWp8hbJd5K59zF1zRbsegboneSzRYnIrfyx8WfS3YCjqRfQIDAQABAoIBAQC5CQAdcqZ9vLpJNilBCJxJLCFmm+HAAREHD8MErg9A5UK1P4S1wJp/0qieGPi68wXBOTgY2xKSwMycgb04/+NyZidVRu388takOW/+KNBg8pMxdZ6/05GqnI0kivSbR3CXpYuz8hekwhpo9+fWmKjApsHL47ItK6WaeKmPbAFsq1YJGzfp/DXg7LIvh9GA3C1LWWGV7SuCGOyX/2Moi8xRa7qBtH4hDo/0NRhTx7zjYjlBgNEr330pJUopc3+AtHE40R+xMr2zkGvq9RsCZxYxD2VWbLwQW0yNjWmQ2OTuMgJJvk2+N73QLHcB+tea82ZTszsNzRS9DLtc6qbsKEPZAoGBAO78U3vEuRyY56f/1hpo0xuCDwOkWGzgBQWkjJl6dlyVz/zKkhXBHpEYImyt8XRN0W3iGZYpZ2hCFJGTcDp32R6UiEyGLz0Uc8R/tva/TiRVW1FdNczzSHcB24b9OMK4vE9JLs8mA8Rp8YBgtLr5DDuMfYt/a/rZJbg/HIfIN98nAoGBAO2OInCX93t2I6zzRPIqKtI6q6FYNp64VIQjvw9Y8l0x3IdJZRP9H5C8ZhCeYPsgEqTXcXa4j5hL4rQzoUtxfxflBUUH60bcnd4LGaTCMYLS14G011E3GZlIP0sJi5OjEhy8fq3zt6jVzS9V/lPHB8i+w1D7CbPrMpW7B3k32vC7AoGAX/HvdkYhZyjAAEOG6m1hK68IZhbp5TP+8CgCxm9S65K9wKh3A8LXibrdvzIKOP4w8WOPkCipOkMlTNibeu24vj01hztr5aK7Y40+oEtnjNCz67N3MQQO+LBHOSeaTRqrh01DPKjvZECAU2D/zfzEe3fIw2Nxr3DUYub7hkvMmosCgYAzxbVVypjiLGYsDDyrdmsstCKxoDMPNmcdAVljc+QmUXaZeXJw/8qAVb78wjeqo1vM1zNgR2rsKyW2VkZB1fN39q7GU6qAIBa7zLmDAduegmr7VrlSduq6UFeS9/qWa4TIBICrUqFlR2tXdKtgANF+e6y/mmaL8qdsoH1JetXZfwKBgQC1vscRpdAXivjOOZAh+mzJWzS4BUl4CTJLYYIuOEXikmN5g0EdV2fhUEdkewmyKnXHsd0x83167bYgpTDNs71jUxDHy5NXlg2qIjLkf09X9wr19gBzDApfWzfh3vUqttyMZuQMLVNepGCWM2vjlY9KGl5OvZqY6d+7yO0mLV9GmQ==-----END RSA PRIVATE KEY-----" And The setting "security-wantAssertionsSigned" is set to "1" - When I send a GET request to "http://localhost/index.php/login" + When I send a GET request to "http://localhost:8080/index.php/login" Then I should be redirected to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO" And I send a POST request to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO?execution=e1s1" with the following data |j_username|j_password|_eventId_proceed| |student1 |password | | And The response should be a SAML redirect page that gets submitted - And I should be redirected to "http://localhost/index.php/apps/dashboard/" + And I should be redirected to "http://localhost:8080/index.php/apps/dashboard/" Then The user value "id" should be "student1" Then The user value "email" should be "" And The user value "display-name" should be "Default displayname of student1" @@ -80,13 +80,13 @@ Feature: Shibboleth And The setting "security-wantAssertionsSigned" is set to "1" And The setting "saml-attribute-mapping-email_mapping" is set to "urn:oid:0.9.2342.19200300.100.1.3" And The setting "saml-attribute-mapping-displayName_mapping" is set to "urn:oid:2.5.4.42 urn:oid:2.5.4.4" - When I send a GET request to "http://localhost/index.php/login" + When I send a GET request to "http://localhost:8080/index.php/login" Then I should be redirected to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO" And I send a POST request to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO?execution=e1s1" with the following data |j_username|j_password|_eventId_proceed| |student1 |password | | And The response should be a SAML redirect page that gets submitted - And I should be redirected to "http://localhost/index.php/apps/dashboard/" + And I should be redirected to "http://localhost:8080/index.php/apps/dashboard/" And The user value "id" should be "student1" And The user value "email" should be "student1@idptestbed.edu" And The user value "display-name" should be "Stud Ent" @@ -105,13 +105,13 @@ Feature: Shibboleth And The setting "security-wantAssertionsSigned" is set to "1" And The setting "saml-attribute-mapping-email_mapping" is set to "urn:oid:0.9.2342.19200300.100.1.3" And The setting "saml-attribute-mapping-displayName_mapping" is set to "urn:oid:2.5.4.42 urn:oid:2.5.4.4" - When I send a GET request to "http://localhost/index.php/settings/help" + When I send a GET request to "http://localhost:8080/index.php/settings/help" Then I should be redirected to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO" And I send a POST request to "https://localhost:4443/idp/profile/SAML2/Redirect/SSO?execution=e1s1" with the following data |j_username|j_password|_eventId_proceed| |student1 |password | | And The response should be a SAML redirect page that gets submitted - And I should be redirected to "http://localhost/index.php/settings/help" + And I should be redirected to "http://localhost:8080/index.php/settings/help" And The user value "id" should be "student1" And The user value "email" should be "student1@idptestbed.edu" And The user value "display-name" should be "Stud Ent" diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index a5a1c4e72..db784a40a 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -30,6 +30,9 @@ class FeatureContext implements Context { /** @var array */ private $changedSettings = []; + private const ENV_CONFIG_FILE = __DIR__ . '/../../../../../../config/env.config.php'; + private const MAIN_CONFIG_FILE = __DIR__ . '/../../../../../../config/config.php'; + public function __construct() { date_default_timezone_set('Europe/Berlin'); } @@ -56,18 +59,21 @@ public function after() { foreach ($users as $user) { shell_exec( sprintf( - 'sudo -u apache %s %s user:delete %s', + '%s %s user:delete %s', PHP_BINARY, __DIR__ . '/../../../../../../occ', $user ) ); + if (file_exists(self::ENV_CONFIG_FILE)) { + unlink(self::ENV_CONFIG_FILE); + } } foreach ($this->changedSettings as $setting) { shell_exec( sprintf( - 'sudo -u apache %s %s config:app:delete user_saml %s', + '%s %s config:app:delete user_saml %s', PHP_BINARY, __DIR__ . '/../../../../../../occ', $setting @@ -77,7 +83,7 @@ public function after() { shell_exec( sprintf( - 'sudo -u apache %s %s saml:config:delete 1', + '%s %s saml:config:delete 1', PHP_BINARY, __DIR__ . '/../../../../../../occ', ) @@ -103,7 +109,7 @@ public function theSettingIsSetTo($settingName, $this->changedSettings[] = $settingName; shell_exec( sprintf( - 'sudo -u apache %s %s config:app:set --value="%s" user_saml %s', + '%s %s config:app:set --value="%s" user_saml %s', PHP_BINARY, __DIR__ . '/../../../../../../occ', $value, @@ -115,7 +121,7 @@ public function theSettingIsSetTo($settingName, shell_exec( sprintf( - 'sudo -u apache %s %s saml:config:set --"%s"="%s" %d', + '%s %s saml:config:set --"%s"="%s" %d', PHP_BINARY, __DIR__ . '/../../../../../../occ', $settingName, @@ -214,7 +220,7 @@ public function theResponseShouldBeASamlRedirectPageThatGetsSubmitted() { $this->response = $this->client->request( 'POST', - 'http://localhost/index.php/apps/user_saml/saml/acs', + 'http://localhost:8080/index.php/apps/user_saml/saml/acs', [ 'form_params' => $postData, ] @@ -231,7 +237,7 @@ public function theResponseShouldBeASamlRedirectPageThatGetsSubmitted() { public function thUserValueShouldBe($key, $value) { $this->response = $this->client->request( 'GET', - 'http://localhost/ocs/v1.php/cloud/user', + 'http://localhost:8080/ocs/v1.php/cloud/user', [ 'headers' => [ 'OCS-APIRequest' => 'true', @@ -266,7 +272,7 @@ public function thUserValueShouldBe($key, $value) { public function aLocalUserWithUidExists($uid) { shell_exec( sprintf( - 'sudo -u apache OC_PASS=password %s %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env', + 'OC_PASS=password %s %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env', PHP_BINARY, __DIR__ . '/../../../../../../occ', $uid @@ -283,7 +289,7 @@ public function aLocalUserWithUidExists($uid) { public function theLastLoginTimestampOfShouldNotBeEmpty($uid) { $response = shell_exec( sprintf( - 'sudo -u apache OC_PASS=password %s %s user:lastseen %s', + 'OC_PASS=password %s %s user:lastseen %s', PHP_BINARY, __DIR__ . '/../../../../../../occ', $uid @@ -301,6 +307,14 @@ public function theLastLoginTimestampOfShouldNotBeEmpty($uid) { * @Given The environment variable :key is set to :value */ public function theEnvironmentVariableIsSetTo($key, $value) { - file_put_contents(__DIR__ . '/../../../../../../.htaccess', "\nSetEnv $key $value\n", FILE_APPEND); + // Attention, this works currently for one value only. It generates an + // extra config file that injects the value to $_SERVER (as used in + // `SAMLController::login()`), so that it stays across requests in PHPs + // built-in server. + $envConfigPhp = << 'Failed scenarios:', 'failed_hooks_title' => 'Failed hooks:', 'failed_steps_title' => 'Failed steps:', + 'failed_step_title' => 'Failed step:', 'pending_steps_title' => 'Pending steps:', 'scenarios_count' => '{0} No scenarios|{1} 1 scenario|]1,Inf] %count% scenarios', 'steps_count' => '{0} No steps|{1} 1 step|]1,Inf] %count% steps', @@ -17,21 +18,22 @@ 'skipped_count' => '[1,Inf] %count% skipped', ), 'bg' => array( - 'snippet_context_choice' => 'В сет %1% има недекларирани стъпки. Изберете в кой Context да бъдат създадени:', - 'snippet_proposal_title' => '%1% има липсващи стъпки. Можете да ги създадете чрез:', - 'snippet_missing_title' => 'Използвайте този снипет --snippets-for за да генерирате кода за следните стъпки %1% през конзолата:', + 'snippet_context_choice' => 'В сет %count% има недекларирани стъпки. Изберете в кой Context да бъдат създадени:', + 'snippet_proposal_title' => '%count% има липсващи стъпки. Можете да ги създадете чрез:', + 'snippet_missing_title' => 'Използвайте този снипет --snippets-for за да генерирате кода за следните стъпки %count% през конзолата:', 'skipped_scenarios_title' => 'Пропуснати сценарии:', 'failed_scenarios_title' => 'Провалени сценарии:', 'failed_hooks_title' => 'Провалени хукове:', 'failed_steps_title' => 'Провалени стъпки:', + 'failed_step_title' => 'Провалени стъпка:', 'pending_steps_title' => 'Изчакващи стъпки:', - 'scenarios_count' => '{0} Няма сценарий|{1} 1 сценарий|]1,Inf] %1% сценарии', - 'steps_count' => '{0} Няма стъпки|{1} 1 стъпка|]1,Inf] %1% стъпки', - 'passed_count' => '[1,Inf] %1% успешни', - 'failed_count' => '[1,Inf] %1% провалени', - 'pending_count' => '[1,Inf] %1% изчакващи', - 'undefined_count' => '[1,Inf] %1% неопределени', - 'skipped_count' => '[1,Inf] %1% пропуснати', + 'scenarios_count' => '{0} Няма сценарий|{1} 1 сценарий|]1,Inf] %count% сценарии', + 'steps_count' => '{0} Няма стъпки|{1} 1 стъпка|]1,Inf] %count% стъпки', + 'passed_count' => '[1,Inf] %count% успешни', + 'failed_count' => '[1,Inf] %count% провалени', + 'pending_count' => '[1,Inf] %count% изчакващи', + 'undefined_count' => '[1,Inf] %count% неопределени', + 'skipped_count' => '[1,Inf] %count% пропуснати', ), 'cs' => array( 'snippet_proposal_title' => '%count% obsahuje chybné kroky. Definujte je za použití následujícího kódu:', @@ -39,6 +41,7 @@ 'failed_scenarios_title' => 'Chybné scénáře:', 'failed_hooks_title' => 'Chybné hooky:', 'failed_steps_title' => 'Chybné kroky:', + 'failed_step_title' => 'Chybné krok:', 'pending_steps_title' => 'Čekající kroky:', 'scenarios_count' => '{0} Žádný scénář|{1} 1 scénář|{2,3,4} %count% scénáře|]4,Inf] %count% scénářů', 'steps_count' => '{0} Žádné kroky|{1} 1 krok|{2,3,4} %count% kroky|]4,Inf] %count% kroků', @@ -54,6 +57,7 @@ 'failed_scenarios_title' => 'Fehlgeschlagene Szenarien:', 'failed_hooks_title' => 'Fehlgeschlagene Hooks:', 'failed_steps_title' => 'Fehlgeschlagene Schritte:', + 'failed_step_title' => 'Fehlgeschlagene Schritt:', 'pending_steps_title' => 'Ausstehende Schritte:', 'scenarios_count' => '{0} Kein Szenario|{1} 1 Szenario|]1,Inf] %count% Szenarien', 'steps_count' => '{0} Kein Schritt|{1} 1 Schritt|]1,Inf] %count% Schritte', @@ -69,6 +73,7 @@ 'failed_scenarios_title' => 'Escenarios fallidos:', 'failed_hooks_title' => 'Hooks fallidos:', 'failed_steps_title' => 'Pasos fallidos:', + 'failed_step_title' => 'Paso fallidos:', 'pending_steps_title' => 'Pasos pendientes:', 'scenarios_count' => '{0} Ningún escenario|{1} 1 escenario|]1,Inf] %count% escenarios', 'steps_count' => '{0} Ningún paso|{1} 1 paso|]1,Inf] %count% pasos', @@ -84,6 +89,7 @@ 'failed_scenarios_title' => 'Scénarios échoués:', 'failed_hooks_title' => 'Hooks échoués:', 'failed_steps_title' => 'Etapes échouées:', + 'failed_step_title' => 'Etape échouées:', 'pending_steps_title' => 'Etapes en attente:', 'scenarios_count' => '{0} Pas de scénario|{1} 1 scénario|]1,Inf] %count% scénarios', 'steps_count' => '{0} Pas d\'étape|{1} 1 étape|]1,Inf] %count% étapes', @@ -101,6 +107,7 @@ 'failed_scenarios_title' => 'Sikertelen forgatókönyvek:', 'failed_hooks_title' => 'Sikertelen kampók:', 'failed_steps_title' => 'Sikertelen lépések:', + 'failed_step_title' => 'Sikertelen lépés:', 'pending_steps_title' => 'Elintézendő lépések:', 'scenarios_count' => '{0} Nem volt forgatókönyv|{1} 1 forgatókönyv|]1,Inf] %count% forgatókönyv', 'steps_count' => '{0} Nem volt lépés|{1} 1 lépés|]1,Inf] %count% lépés', @@ -116,6 +123,7 @@ 'failed_scenarios_title' => 'Scenari falliti:', 'failed_hooks_title' => 'Hook falliti:', 'failed_steps_title' => 'Passaggi falliti:', + 'failed_step_title' => 'Passaggio fallito:', 'pending_steps_title' => 'Passaggi in sospeso:', 'scenarios_count' => '{0} Nessuno scenario|{1} 1 scenario|]1,Inf] %count% scenari', 'steps_count' => '{0} Nessun passaggio|{1} 1 passaggio|]1,Inf] %count% passaggi', @@ -132,6 +140,7 @@ 'failed_scenarios_title' => '失敗した シナリオ:', 'failed_hooks_title' => '失敗した フック:', 'failed_steps_title' => '失敗した ステップ:', + 'failed_step_title' => '失敗した ステップ:', 'pending_steps_title' => '保留中のステップ:', 'scenarios_count' => '{0} No scenarios|{1} 1 個のシナリオ|]1,Inf] %count% 個のシナリオ', 'steps_count' => '{0} ステップがありません|{1} 1 個のステップ|]1,Inf] %count% 個のステップ', @@ -142,20 +151,21 @@ 'skipped_count' => '[1,Inf] %count% 個スキップ', ), 'ko' => array( - 'snippet_proposal_title' => '%1% 정의가 되지 않았습니다. 스니펫을 생성할 컨텍스트를 선택하십시오:', - 'snippet_missing_title' => '%1% 단계가 누락되었습니다. 스니펫을 정의해주세요:', + 'snippet_proposal_title' => '%count% 정의가 되지 않았습니다. 스니펫을 생성할 컨텍스트를 선택하십시오:', + 'snippet_missing_title' => '%count% 단계가 누락되었습니다. 스니펫을 정의해주세요:', 'skipped_scenarios_title' => '건너뛴 시나리오:', 'failed_scenarios_title' => '실패한 시나리오:', 'failed_hooks_title' => '실패한 훅 연결:', 'failed_steps_title' => '실패한 단계:', + 'failed_step_title' => '실패한 단계:', 'pending_steps_title' => '준비중인 단계:', - 'scenarios_count' => '{0} 없는 시나리오들|{1} 1 시나리오|]1,Inf] %1% 시나리오들', - 'steps_count' => '{0} 없는 단계들|{1} 1 단계|]1,Inf] %1% 단계들', - 'passed_count' => '[1,Inf] %1% 통과', - 'failed_count' => '[1,Inf] %1% 실패', - 'pending_count' => '[1,Inf] %1% 준비중', - 'undefined_count' => '[1,Inf] %1% 정의되지 않았습니다.', - 'skipped_count' => '[1,Inf] %1% 건너뜀', + 'scenarios_count' => '{0} 없는 시나리오들|{1} 1 시나리오|]1,Inf] %count% 시나리오들', + 'steps_count' => '{0} 없는 단계들|{1} 1 단계|]1,Inf] %count% 단계들', + 'passed_count' => '[1,Inf] %count% 통과', + 'failed_count' => '[1,Inf] %count% 실패', + 'pending_count' => '[1,Inf] %count% 준비중', + 'undefined_count' => '[1,Inf] %count% 정의되지 않았습니다.', + 'skipped_count' => '[1,Inf] %count% 건너뜀', ), 'nl' => array( 'snippet_proposal_title' => 'Ontbrekende stappen in %count%. Definieer ze met de volgende fragmenten:', @@ -163,6 +173,7 @@ 'failed_scenarios_title' => 'Gefaalde scenario\'s:', 'failed_hooks_title' => 'Gefaalde hooks:', 'failed_steps_title' => 'Gefaalde stappen:', + 'failed_step_title' => 'Gefaalde stap:', 'pending_steps_title' => 'Onafgewerkte stappen:', 'scenarios_count' => '{0} Geen scenario\'s|{1} 1 scenario|]1,Inf] %count% scenario\'s', 'steps_count' => '{0} Geen stappen|{1} 1 stap|]1,Inf] %count% stappen', @@ -178,6 +189,7 @@ 'failed_scenarios_title' => 'Feilende scenarier:', 'failed_hooks_title' => 'Feilende hooks:', 'failed_steps_title' => 'Feilende steg:', + 'failed_step_title' => 'Feilende steg:', 'pending_steps_title' => 'Ikke implementerte steg:', 'scenarios_count' => '{0} Ingen scenarier|{1} 1 scenario|]1,Inf] %count% scenarier', 'steps_count' => '{0} Ingen steg|{1} 1 steg|]1,Inf] %count% steg', @@ -193,6 +205,7 @@ 'failed_scenarios_title' => 'Nieudane scenariusze:', 'failed_hooks_title' => 'Nieudane hooki:', 'failed_steps_title' => 'Nieudane kroki', + 'failed_step_title' => 'Nieudane krok:', 'pending_steps_title' => 'Oczekujące kroki', 'scenarios_count' => '{0} Brak scenariuszy|{1} 1 scenariusz|{2,3,4,22,23,24,32,33,34,42,43,44} %count% scenariusze|]4,Inf] %count% scenariuszy', 'steps_count' => '{0} Brak kroków|{1} 1 krok|{2,3,4,22,23,24,32,33,34,42,43,44} %count% kroki|]4,Inf] %count% kroków', @@ -208,6 +221,7 @@ 'failed_scenarios_title' => 'Cenários que falharam:', 'failed_hooks_title' => 'Hooks que falharam:', 'failed_steps_title' => 'Definições que falharam:', + 'failed_step_title' => 'Definição que falhou:', 'pending_steps_title' => 'Definições por definir:', 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários', 'steps_count' => '{0} Nenhuma definição|{1} 1 definição|]1,Inf] %count% definições', @@ -223,6 +237,7 @@ 'failed_scenarios_title' => 'Cenários falhados:', 'failed_hooks_title' => 'Hooks falhados:', 'failed_steps_title' => 'Etapas falhadas:', + 'failed_step_title' => 'Etapa com falha:', 'pending_steps_title' => 'Etapas pendentes:', 'scenarios_count' => '{0} Nenhum cenário|{1} 1 cenário|]1,Inf] %count% cenários', 'steps_count' => '{0} Nenhuma etapa|{1} 1 etapa|]1,Inf] %count% etapas', @@ -239,6 +254,7 @@ 'failed_scenarios_title' => 'Scenarii eșuate:', 'failed_hooks_title' => 'Hook-uri eșuate:', 'failed_steps_title' => 'Pași esuați:', + 'failed_step_title' => 'Paș esuaț:', 'pending_steps_title' => 'Pași in așteptare:', 'scenarios_count' => '{0} Niciun scenariu|{1} 1 scenariu|]1,Inf] %count% scenarii', 'steps_count' => '{0} Niciun pas|{1} 1 pas|]1,Inf] %count% pasi', @@ -255,6 +271,7 @@ 'failed_scenarios_title' => 'Проваленные сценарии:', 'failed_hooks_title' => 'Проваленные хуки:', 'failed_steps_title' => 'Проваленные шаги:', + 'failed_step_title' => 'Проваленные шаг:', 'pending_steps_title' => 'Шаги в ожидании:', 'scenarios_count' => '{0} Нет сценариев|{1,21,31} %count% сценарий|{2,3,4,22,23,24} %count% сценария|]4,Inf] %count% сценариев', 'steps_count' => '{0} Нет шагов|{1,21,31} %count% шаг|{2,3,4,22,23,24} %count% шага|]4,Inf] %count% шагов', @@ -264,4 +281,21 @@ 'undefined_count' => '{1,21,31} %count% не определен|]1,Inf] %count% не определено', 'skipped_count' => '{1,21,31} %count% пропущен|]1,Inf] %count% пропущено', ), + 'zh' => array( + 'snippet_context_choice' => '%count% 有新的场景步骤, 请选择要生成代码片段的ContextClass:', + 'snippet_proposal_title' => '%count% 已经更新。 请检查生成片段:', + 'snippet_missing_title' => '您可以使用 --snippets-for CLI命令更新 %count% 的ContextClass:', + 'skipped_scenarios_title' => '跳过场景:', + 'failed_scenarios_title' => '失败的场景:', + 'failed_hooks_title' => '失败的挂钩(hooks):', + 'failed_steps_title' => '失败的步骤:', + 'pending_steps_title' => '生成的步骤:', + 'scenarios_count' => '{0} No scenarios|{1} 1 个场景|]1,Inf] %count% 个场景', + 'steps_count' => '{0} 没有步骤|{1} 1 个步骤|]1,Inf] %count% 个步骤', + 'passed_count' => '[1,Inf] %count% 个成功', + 'failed_count' => '[1,Inf] %count% 个失败', + 'pending_count' => '[1,Inf] %count% 个待实现方法', + 'undefined_count' => '[1,Inf] %count% 个未定义', + 'skipped_count' => '[1,Inf] %count% 个跳过', + ), ); diff --git a/tests/integration/vendor/behat/behat/psalm.xml b/tests/integration/vendor/behat/behat/psalm.xml index 99f6bdb8d..067db6cc4 100644 --- a/tests/integration/vendor/behat/behat/psalm.xml +++ b/tests/integration/vendor/behat/behat/psalm.xml @@ -32,6 +32,13 @@ + + + + + + + diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php index df699077e..f2870ae53 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/ApplicationFactory.php @@ -46,7 +46,7 @@ */ final class ApplicationFactory extends BaseFactory { - public const VERSION = '3.8.1'; + public const VERSION = '3.13.0'; /** * {@inheritdoc} diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php index 44bcf29b8..c63543eb6 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/ContextEnvironment.php @@ -10,6 +10,7 @@ namespace Behat\Behat\Context\Environment; +use Behat\Behat\Context\Context; use Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler; use Behat\Testwork\Environment\Environment; @@ -32,14 +33,14 @@ public function hasContexts(); /** * Returns list of registered context classes. * - * @return string[] + * @return list> */ public function getContextClasses(); /** * Checks if environment contains context with the specified class name. * - * @param string $class + * @param class-string $class * * @return bool */ diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php index 053354963..45774d1d2 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/InitializedContextEnvironment.php @@ -36,7 +36,8 @@ final class InitializedContextEnvironment implements ContextEnvironment, Service */ private $serviceContainer; /** - * @var Context[] + * @var array, Context> + * @psalm-var class-string-map */ private $contexts = array(); @@ -103,7 +104,7 @@ public function hasContextClass($class) /** * Returns list of registered context instances. * - * @return Context[] + * @return list */ public function getContexts() { @@ -113,9 +114,11 @@ public function getContexts() /** * Returns registered context by its class name. * - * @param string $class + * @template T of Context * - * @return Context + * @param class-string $class + * + * @return T * * @throws ContextNotFoundException If context is not in the environment */ diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/UninitializedContextEnvironment.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/UninitializedContextEnvironment.php index d0ff98551..a517d5f74 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/UninitializedContextEnvironment.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Context/Environment/UninitializedContextEnvironment.php @@ -10,6 +10,7 @@ namespace Behat\Behat\Context\Environment; +use Behat\Behat\Context\Context; use Behat\Behat\Context\Environment\Handler\ContextEnvironmentHandler; use Behat\Behat\Context\Exception\ContextNotFoundException; use Behat\Behat\Context\Exception\WrongContextClassException; @@ -25,15 +26,15 @@ final class UninitializedContextEnvironment extends StaticEnvironment implements ContextEnvironment { /** - * @var array[] + * @var array, array> */ private $contextClasses = array(); /** * Registers context class. * - * @param string $contextClass - * @param null|array $arguments + * @param class-string $contextClass + * @param null|array $arguments * * @throws ContextNotFoundException If class does not exist * @throws WrongContextClassException if class does not implement Context interface @@ -86,7 +87,7 @@ public function hasContextClass($class) /** * Returns context classes with their arguments. * - * @return array[] + * @return array, array> */ public function getContextClassesWithArguments() { diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php index c37300f77..7fcfd2f7c 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Definition/Context/Attribute/DefinitionAttributeReader.php @@ -58,6 +58,9 @@ public function readCallees(string $contextClass, ReflectionMethod $method) return []; } + /** + * @psalm-suppress UndefinedClass (ReflectionAttribute is PHP 8.0 only) + */ $attributes = $method->getAttributes(Definition::class, \ReflectionAttribute::IS_INSTANCEOF); $callees = []; diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php index 0f131cbc0..85d302fb9 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php @@ -12,6 +12,7 @@ use Behat\Behat\HelperContainer\Exception\ServiceNotFoundException; use Behat\Behat\HelperContainer\Exception\WrongServicesConfigurationException; +use Psr\Container\ContainerInterface as PsrContainerInterface; use ReflectionClass; use ReflectionMethod; @@ -20,7 +21,7 @@ * * @author Konstantin Kudryashov */ -final class BuiltInServiceContainer implements ContainerInterface +final class BuiltInServiceContainer implements PsrContainerInterface { /** * @var array @@ -44,7 +45,7 @@ public function __construct(array $schema) /** * {@inheritdoc} */ - public function has($id) + public function has($id): bool { return array_key_exists($id, $this->schema); } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php index 75fb43fa8..88998ff4c 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/HelperContainer/ContainerInterface.php @@ -10,12 +10,7 @@ namespace Behat\Behat\HelperContainer; -class_alias( - interface_exists('Interop\\Container\\ContainerInterface') - ? 'Interop\\Container\\ContainerInterface' - : 'Psr\\Container\\ContainerInterface', - 'Behat\\Behat\\HelperContainer\\ContainerInterface' -); +class_alias('Psr\\Container\\ContainerInterface', 'Behat\\Behat\\HelperContainer\\ContainerInterface'); if (false) { /** diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php index f49dd93dc..4d569b28a 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Hook/Context/Attribute/HookAttributeReader.php @@ -59,6 +59,9 @@ public function readCallees(string $contextClass, ReflectionMethod $method) return []; } + /** + * @psalm-suppress UndefinedClass (ReflectionAttribute is PHP 8.0 only) + */ $attributes = $method->getAttributes(Hook::class, \ReflectionAttribute::IS_INSTANCEOF); $callees = []; diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php index 031accdaa..2aae5a2cf 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/JUnit/JUnitFeatureElementListener.php @@ -169,7 +169,13 @@ public function printFeatureOnAfterEvent(Formatter $formatter, Event $event) foreach ($this->afterScenarioTestedEvents as $afterScenario) { $afterScenarioTested = $afterScenario['event']; - $this->scenarioPrinter->printOpenTag($formatter, $afterScenarioTested->getFeature(), $afterScenarioTested->getScenario(), $afterScenarioTested->getTestResult()); + $this->scenarioPrinter->printOpenTag( + $formatter, + $afterScenarioTested->getFeature(), + $afterScenarioTested->getScenario(), + $afterScenarioTested->getTestResult(), + $event->getFeature()->getFile() + ); /** @var AfterStepSetup $afterStepSetup */ foreach ($afterScenario['step_setup_events'] as $afterStepSetup) { diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php index 0ca46e987..8ed7b09ab 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/JUnit/JUnitScenarioPrinter.php @@ -63,7 +63,7 @@ public function __construct(ResultToStringConverter $resultConverter, JUnitOutli /** * {@inheritDoc} */ - public function printOpenTag(Formatter $formatter, FeatureNode $feature, ScenarioLikeInterface $scenario, TestResult $result) + public function printOpenTag(Formatter $formatter, FeatureNode $feature, ScenarioLikeInterface $scenario, TestResult $result, string $file = null) { $name = implode(' ', array_map(function ($l) { return trim($l); @@ -76,12 +76,21 @@ public function printOpenTag(Formatter $formatter, FeatureNode $feature, Scenari /** @var JUnitOutputPrinter $outputPrinter */ $outputPrinter = $formatter->getOutputPrinter(); - $outputPrinter->addTestcase(array( - 'name' => $name, + $testCaseAttributes = array( + 'name' => $name, 'classname' => $feature->getTitle(), - 'status' => $this->resultConverter->convertResultToString($result), - 'time' => $this->durationListener ? $this->durationListener->getDuration($scenario) : '' - )); + 'status' => $this->resultConverter->convertResultToString($result), + 'time' => $this->durationListener ? $this->durationListener->getDuration($scenario) : '' + ); + + if ($file) { + $cwd = realpath(getcwd()); + $testCaseAttributes['file'] = + substr($file, 0, strlen($cwd)) === $cwd ? + ltrim(substr($file, strlen($cwd)), DIRECTORY_SEPARATOR) : $file; + } + + $outputPrinter->addTestcase($testCaseAttributes); } /** diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyExampleRowPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyExampleRowPrinter.php index 109dd25d6..2713fc098 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyExampleRowPrinter.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/Node/Printer/Pretty/PrettyExampleRowPrinter.php @@ -10,6 +10,7 @@ namespace Behat\Behat\Output\Node\Printer\Pretty; +use Behat\Behat\Definition\Translator\TranslatorInterface; use Behat\Behat\EventDispatcher\Event\AfterStepTested; use Behat\Behat\Output\Node\Printer\ExampleRowPrinter; use Behat\Behat\Output\Node\Printer\Helper\ResultToStringConverter; @@ -47,6 +48,10 @@ final class PrettyExampleRowPrinter implements ExampleRowPrinter * @var string */ private $subIndentText; + /** + * @var TranslatorInterface + */ + private $translator; /** * Initializes printer. @@ -59,11 +64,13 @@ final class PrettyExampleRowPrinter implements ExampleRowPrinter public function __construct( ResultToStringConverter $resultConverter, ExceptionPresenter $exceptionPresenter, + TranslatorInterface $translator, $indentation = 6, $subIndentation = 2 ) { $this->resultConverter = $resultConverter; $this->exceptionPresenter = $exceptionPresenter; + $this->translator = $translator; $this->indentText = str_repeat(' ', intval($indentation)); $this->subIndentText = $this->indentText . str_repeat(' ', intval($subIndentation)); } @@ -124,7 +131,7 @@ private function printStepExceptionsAndStdOut(OutputPrinter $printer, array $eve { foreach ($events as $event) { $this->printStepStdOut($printer, $event->getTestResult()); - $this->printStepException($printer, $event->getTestResult()); + $this->printStepException($printer, $event); } } @@ -132,16 +139,24 @@ private function printStepExceptionsAndStdOut(OutputPrinter $printer, array $eve * Prints step exception (if has one). * * @param OutputPrinter $printer - * @param StepResult $result + * @param AfterTested $event */ - private function printStepException(OutputPrinter $printer, StepResult $result) + private function printStepException(OutputPrinter $printer, AfterTested $event) { + $result = $event->getTestResult(); + $style = $this->resultConverter->convertResultToString($result); if (!$result instanceof ExceptionResult || !$result->hasException()) { return; } + if ($event instanceof AfterStepTested) { + $title = $this->translator->trans('failed_step_title', [], 'output'); + $step = $event->getStep(); + $printer->writeln(sprintf('{+%s}%s%s %s %s{-%s}', $style, $this->subIndentText, $title, $step->getKeyword(), $step->getText(), $style)); + } + $text = $this->exceptionPresenter->presentException($result->getException()); $indentedText = implode("\n", array_map(array($this, 'subIndent'), explode("\n", $text))); $printer->writeln(sprintf('{+%s}%s{-%s}', $style, $indentedText, $style)); diff --git a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php index b2d266025..b737ef289 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Behat/Output/ServiceContainer/Formatter/PrettyFormatterFactory.php @@ -257,7 +257,8 @@ protected function loadTableOutlinePrinter(ContainerBuilder $container) $definition = new Definition('Behat\Behat\Output\Node\Printer\Pretty\PrettyExampleRowPrinter', array( new Reference(self::RESULT_TO_STRING_CONVERTER_ID), - new Reference(ExceptionExtension::PRESENTER_ID) + new Reference(ExceptionExtension::PRESENTER_ID), + new Reference(TranslatorExtension::TRANSLATOR_ID) )); $container->setDefinition('output.node.printer.pretty.example_row', $definition); } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php index 49694e298..f9a6a4b54 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Argument/MixedArgumentOrganiser.php @@ -241,6 +241,9 @@ private function getReflectionClassesFromParameter(\ReflectionParameter $paramet $type = $parameter->getType(); + /** + * @psalm-suppress UndefinedClass (ReflectionUnionType) + */ if ($type instanceof \ReflectionNamedType) { $types = [$type]; } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php index 006b3f1b7..ad57803d5 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Cli/Application.php @@ -184,7 +184,7 @@ private function createContainer(InputInterface $input, OutputInterface $output) $extension = new ContainerLoader($this->extensionManager); $extension->load($container, $this->loadConfiguration($input)); $container->addObjectResource($extension); - $container->compile(); + $container->compile(true); return $container; } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php index 4569391a7..f0d7d2c3b 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Cli/SigintController.php @@ -55,6 +55,10 @@ public function execute(InputInterface $input, OutputInterface $output) { if (function_exists('pcntl_signal')) { pcntl_async_signals(true); + + /** + * @psalm-suppress UndefinedConstant (SIGINT is defined in pcntl) + */ pcntl_signal(SIGINT, array($this, 'abortExercise')); } } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php index 0b06299ef..17343f15a 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Exception/Stringer/PHPUnitExceptionStringer.php @@ -35,6 +35,10 @@ public function supportsException(Exception $exception) */ public function stringException(Exception $exception, $verbosity) { + if (class_exists('PHPUnit\\Util\\ThrowableToStringMapper')) { + return trim(\PHPUnit\Util\ThrowableToStringMapper::map($exception)); + } + if (!class_exists('PHPUnit\\Framework\\TestFailure')) { return trim(\PHPUnit_Framework_TestFailure::exceptionToString($exception)); } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php index f415b96a1..ce1371c93 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/Output/Printer/JUnitOutputPrinter.php @@ -115,7 +115,7 @@ public function addTestcaseChild($nodeName, array $nodeAttributes = array(), $no private function addAttributesToNode(\DOMElement $node, array $attributes) { foreach ($attributes as $name => $value){ - $node->setAttribute($name, $value); + $node->setAttribute($name, $value ?? ''); } } diff --git a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Extension.php b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Extension.php index 9533dcaa3..68e62f576 100644 --- a/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Extension.php +++ b/tests/integration/vendor/behat/behat/src/Behat/Testwork/ServiceContainer/Extension.php @@ -53,8 +53,8 @@ public function configure(ArrayNodeDefinition $builder); /** * Loads extension services into temporary container. * - * @param ContainerBuilder $container - * @param array $config + * @param ContainerBuilder $container + * @param array $config */ public function load(ContainerBuilder $container, array $config); } diff --git a/tests/integration/vendor/behat/transliterator/CHANGELOG.md b/tests/integration/vendor/behat/transliterator/CHANGELOG.md index a6cf15ecc..8cd857336 100644 --- a/tests/integration/vendor/behat/transliterator/CHANGELOG.md +++ b/tests/integration/vendor/behat/transliterator/CHANGELOG.md @@ -1,3 +1,12 @@ +# 1.5.0 / 2022-03-30 + +- Bump the min PHP version to 7.2 + +# 1.4.0 / 2022-03-30 + +- Updated Unicode bank files +- Add CI builds on PHP 8 and 8.1 + # 1.3.0 / 2020-01-14 - Fix existing Travis CI builds diff --git a/tests/integration/vendor/behat/transliterator/README.md b/tests/integration/vendor/behat/transliterator/README.md index 78475954c..0685ae024 100644 --- a/tests/integration/vendor/behat/transliterator/README.md +++ b/tests/integration/vendor/behat/transliterator/README.md @@ -3,13 +3,10 @@ Behat Transliterator Behat Transliterator provides transliteration utilities for PHP. -Transliteration data are ported from the [Perl Text-Unidecode module](http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm). +Transliteration data are ported from the [Perl Text-Unidecode module](https://metacpan.org/pod/Text::Unidecode). [![License](https://poser.pugx.org/behat/transliterator/license.svg)](https://packagist.org/packages/behat/transliterator) -[![Build Status](https://travis-ci.org/Behat/Transliterator.svg)](https://travis-ci.org/Behat/Transliterator) -[![HHVM Status](http://hhvm.h4cc.de/badge/behat/transliterator.svg?branch=master)](http://hhvm.h4cc.de/package/behat/transliterator) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Behat/Transliterator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/Behat/Transliterator/?branch=master) -[![Code Coverage](https://scrutinizer-ci.com/g/Behat/Transliterator/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/Behat/Transliterator/?branch=master) +[![CI](https://github.com/Behat/Transliterator/actions/workflows/ci.yml/badge.svg)](https://github.com/Behat/Transliterator/actions/workflows/ci.yml) [![Total Downloads](https://poser.pugx.org/behat/transliterator/downloads.svg)](https://packagist.org/packages/behat/transliterator) Installation @@ -18,7 +15,7 @@ Installation The easiest way to install Behat is by using [Composer](https://getcomposer.org): ```bash -$ composer require behat/transliterator +composer require behat/transliterator ``` Usage diff --git a/tests/integration/vendor/behat/transliterator/composer.json b/tests/integration/vendor/behat/transliterator/composer.json index fd1cd0ab1..e42c322d0 100644 --- a/tests/integration/vendor/behat/transliterator/composer.json +++ b/tests/integration/vendor/behat/transliterator/composer.json @@ -9,10 +9,10 @@ "type": "library", "license": "Artistic-1.0", "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "require-dev": { - "phpunit/phpunit": "^4.8.36|^6.3", + "phpunit/phpunit": "^8.5.25 || ^9.5.19", "php-yaoi/php-yaoi": "^1.0", "chuyskywalker/rolling-curl": "^3.1" }, @@ -28,7 +28,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.x-dev" } } } diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php index 87a07c72e..ce4a4c6d3 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php @@ -5,7 +5,7 @@ use RollingCurl\Request; use RollingCurl\RollingCurl; use Yaoi\Command; -use Yaoi\Command\Option; +use Yaoi\Command\Definition; use Yaoi\Http\Client; use Yaoi\String\Lexer\Parsed; use Yaoi\String\Lexer\Parser; @@ -20,7 +20,7 @@ */ class SyncTool extends Command { - const LIB_VERSION = '1.27'; + const LIB_VERSION = '1.30'; private $tokenizer; private $renderer; @@ -55,7 +55,7 @@ public function __construct() ->keepBoundaries('['); } - public static function setUpDefinition(\Yaoi\Command\Definition $definition, $options) + public static function setUpDefinition(Definition $definition, $options) { $definition->name = 'update-data'; $definition->description = 'Tool for converting char tables for Behat/Transliterator from Perl to PHP'; @@ -202,9 +202,9 @@ private function getPerlTablesUrlList() { $client = new Client(); $list = array(); - $page = $client->fetch('http://cpansearch.perl.org/src/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/'); - foreach (StringParser::create($page)->innerAll('.pm">', '') as $xXXpm) { - $list[] = 'http://cpansearch.perl.org/src/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/' + $page = $client->fetch('https://st.aticpan.org/source/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/'); + foreach (StringParser::create($page)->innerAll('.pm\'>', '') as $xXXpm) { + $list[] = 'https://st.aticpan.org/source/SBURKE/Text-Unidecode-' . self::LIB_VERSION . '/lib/Text/Unidecode/' . $xXXpm; } return $list; diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php index c6e3a08e3..adae85977 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x02.php @@ -14,6 +14,6 @@ 'h', 'h', 'j', 'r', 'r', 'r', 'r', 'w', 'y', '\'', '"', '`', '\'', '`', '`', '\'', '?', '?', '<', '>', '^', 'V', '^', 'V', '\'', '-', '/', '\\', ',', '_', '\\', '/', ':', '.', '`', '\'', '^', 'V', '+', '-', 'V', '.', '@', ',', '~', '"', 'R', 'X', -'G', 'l', 's', 'x', '?', '', '', '', '', '', '', '', 'V', '=', '"', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'G', 'l', 's', 'x', '?', '5', '4', '3', '2', '1', '/', '\\\\', 'V', '=', '"', 'V', +'^', '<', '>', 'o', '`', '``', '//', '~', ':', '[-', '-]', '[_', '_]', '_', '_', '<', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php index a923ec04e..ed8572c5d 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x03.php @@ -15,5 +15,5 @@ 'p', 'r', 's', 's', 't', 'u', 'ph', 'kh', 'ps', 'o', 'i', 'u', 'o', 'u', 'o', '[?]', 'b', 'th', 'U', 'U', 'U', 'ph', 'p', '&', '[?]', '[?]', 'St', 'st', 'W', 'w', 'Q', 'q', 'Sp', 'sp', 'Sh', 'sh', 'F', 'f', 'Kh', 'kh', 'H', 'h', 'G', 'g', 'CH', 'ch', 'Ti', 'ti', -'k', 'r', 'c', 'j', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'k', 'r', 'c', 'j', 'TH', 'e', 'e', 'Sh', 'sh', 's', '[?]', '[?]', 'r/', 'S', 'S.', 'S.', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php index 302181f26..c461f8d52 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x04.php @@ -15,5 +15,5 @@ '`', 'Zh', 'zh', 'K\'', 'k\'', '[?]', '[?]', 'N\'', 'n\'', '[?]', '[?]', 'Ch', 'ch', '[?]', '[?]', '[?]', 'a', 'a', 'A', 'a', 'Ae', 'ae', 'Ie', 'ie', '@', '@', '@', '@', 'Zh', 'zh', 'Z', 'z', 'Dz', 'dz', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o', 'O', 'o', 'E', 'e', 'U', 'u', -'U', 'u', 'U', 'u', 'Ch', 'ch', '[?]', '[?]', 'Y', 'y', '[?]', '[?]', '[?]', '[?]', '[?]', +'U', 'u', 'U', 'u', 'Ch', 'ch', '[?]', '[?]', 'Y', 'y', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x05.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x05.php index 197c54c81..b02952daa 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x05.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x05.php @@ -15,5 +15,5 @@ '|', '', '', ':', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '', 'b', 'g', 'd', 'h', 'v', 'z', 'kh', 't', 'y', 'k', 'k', 'l', 'm', 'm', 'n', 'n', 's', '`', 'p', 'p', 'ts', 'ts', 'q', 'r', 'sh', 't', '[?]', '[?]', '[?]', '[?]', '[?]', -'V', 'oy', 'i', '\'', '"', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'V', 'oy', 'i', '\'', '"', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x06.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x06.php index 7f10faf7b..115b983eb 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x06.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x06.php @@ -15,5 +15,5 @@ 'hy', 'h', 'H', '@', 'W', 'oe', 'oe', 'u', 'yu', 'yu', 'W', 'v', 'y', 'Y', 'Y', 'W', '', '', 'y', 'y\'', '.', 'ae', '', '', '', '', '', '', '', '@', '#', '', '', '', '', '', '', '', '', '', '', '^', '', '', '', '', '[?]', '[?]', -'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Sh', 'D', 'Gh', '&', '+m', +'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'Sh', 'D', 'Gh', '&', '+m', 'h', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x07.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x07.php index 96f76f1d3..7cdd0c8aa 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x07.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x07.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x09.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x09.php index 7d70c249f..6fec3fddc 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x09.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x09.php @@ -15,5 +15,5 @@ 'ii', 'u', 'uu', 'R', 'RR', '[?]', '[?]', 'e', 'ai', '[?]', '[?]', 'o', 'au', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '+', '[?]', '[?]', '[?]', '[?]', 'rr', 'rh', '[?]', 'yy', 'RR', 'LL', 'L', 'LL', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', -'r\'', 'r`', 'Rs', 'Rs', '1/', '2/', '3/', '4/', ' 1 - 1/', '/16', '', '[?]', '[?]', '[?]', '[?]', +'r\'', 'r`', 'Rs', 'Rs', '1/', '2/', '3/', '4/', ' 1 - 1/', '/16', '', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0a.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0a.php index 312120977..8d48be94f 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0a.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0a.php @@ -15,5 +15,5 @@ 'ii', 'u', 'uu', 'R', 'RR', 'eN', '[?]', 'e', 'ai', 'oN', '[?]', 'o', 'au', '', '[?]', '[?]', 'AUM', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', 'RR', '[?]', '[?]', '[?]', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'.', 'R', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', 'zh', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0b.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0b.php index a8b1f08de..0bc8a97d2 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0b.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0b.php @@ -15,5 +15,5 @@ 'ii', 'u', 'uu', '[?]', '[?]', '[?]', 'e', 'ee', 'ai', '[?]', 'o', 'oo', 'au', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '+', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', -'+10+', '+100+', '+1000+', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'+10+', '+100+', '+1000+', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0c.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0c.php index 68dd1bab9..714b21e8b 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0c.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0c.php @@ -15,5 +15,5 @@ 'ii', 'u', 'uu', 'R', 'RR', '[?]', 'e', 'ee', 'ai', '[?]', 'o', 'oo', 'au', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '+', '+', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', 'lll', '[?]', 'RR', 'LL', '[?]', '[?]', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0d.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0d.php index c710e2c48..803c481d0 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0d.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0d.php @@ -15,5 +15,5 @@ 'v', 'sh', 'ss', 's', 'h', 'll', 'f', '[?]', '[?]', '[?]', '', '[?]', '[?]', '[?]', '[?]', 'aa', 'ae', 'aae', 'i', 'ii', 'u', '[?]', 'uu', '[?]', 'R', 'e', 'ee', 'ai', 'o', 'oo', 'au', 'L', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', 'RR', 'LL', ' . ', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', 'RR', 'LL', ' . ', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0e.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0e.php index 57604bd01..d2e86c100 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0e.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0e.php @@ -15,5 +15,5 @@ 'e', 'ei', 'o', 'ay', 'ai', '[?]', '+', '[?]', '', '', '', '', '', 'M', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '[?]', '[?]', 'hn', 'hm', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0f.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0f.php index 9011d764f..dee967756 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0f.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x0f.php @@ -15,5 +15,5 @@ ' /O/ ', ' /o/ ', ' \\o\\ ', ' (O) ', '', '', '', '', '', '', '', '', '', '[?]', '[?]', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x10.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x10.php index eeee18e6f..3c0019351 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x10.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x10.php @@ -15,5 +15,5 @@ 'H', 'E', 'Y', 'W', 'Xh', 'OE', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', 'a', 'b', 'g', 'd', 'e', 'v', 'z', 't`', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'zh', 'r', 's', 't', 'u', 'p`', 'k`', 'g\'', 'q', 'sh', 'ch`', 'c`', 'z\'', 'c', 'ch', 'x', 'j', -'h', 'e', 'y', 'w', 'xh', 'oe', 'f', '[?]', '[?]', '[?]', '[?]', ' // ', '[?]', '[?]', '[?]', +'h', 'e', 'y', 'w', 'xh', 'oe', 'f', '[?]', '[?]', '[?]', '[?]', ' // ', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x11.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x11.php index 56de2a83c..3a9c392cf 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x11.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x11.php @@ -15,5 +15,5 @@ 't', 'p', 'h', 'gl', 'gsg', 'ng', 'nd', 'ns', 'nZ', 'nt', 'dg', 'tl', 'lgs', 'ln', 'ld', 'lth', 'll', 'lmg', 'lms', 'lbs', 'lbh', 'rNp', 'lss', 'lZ', 'lk', 'lQ', 'mg', 'ml', 'mb', 'ms', 'mss', 'mZ', 'mc', 'mh', 'mN', 'bl', 'bp', 'ph', 'pN', 'sg', 'sd', 'sl', 'sb', 'Z', 'g', 'ss', '', 'kh', -'N', 'Ns', 'NZ', 'pb', 'pN', 'hn', 'hl', 'hm', 'hb', 'Q', '[?]', '[?]', '[?]', '[?]', '[?]', +'N', 'Ns', 'NZ', 'pb', 'pN', 'hn', 'hl', 'hm', 'hb', 'Q', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x13.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x13.php index d98dac1ed..f8a4b2c6e 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x13.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x13.php @@ -15,5 +15,5 @@ 'nah', 'ne', 'ni', 'no', 'nu', 'nv', 'qua', 'que', 'qui', 'quo', 'quu', 'quv', 'sa', 's', 'se', 'si', 'so', 'su', 'sv', 'da', 'ta', 'de', 'te', 'di', 'ti', 'do', 'du', 'dv', 'dla', 'tla', 'tle', 'tli', 'tlo', 'tlu', 'tlv', 'tsa', 'tse', 'tsi', 'tso', 'tsu', 'tsv', 'wa', 'we', 'wi', 'wo', 'wu', 'wv', 'ya', -'ye', 'yi', 'yo', 'yu', 'yv', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'ye', 'yi', 'yo', 'yu', 'yv', 'MV', '[?]', '[?]', 'ye', 'yi', 'yo', 'yu', 'yv', 'mv', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x16.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x16.php index fc397e239..3e885f921 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x16.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x16.php @@ -15,5 +15,5 @@ 'n', 'i', 'e', 'j', 'g', 'ae', 'a', 'eo', 'p', 'z', 's', 's', 's', 'c', 'z', 't', 't', 'd', 'b', 'b', 'p', 'p', 'e', 'm', 'm', 'm', 'l', 'l', 'ng', 'ng', 'd', 'o', 'ear', 'ior', 'qu', 'qu', 'qu', 's', 'yr', 'yr', 'yr', 'q', 'x', '.', ':', '+', '17', '18', -'19', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'19', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x17.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x17.php index ebeba64a0..857b54d93 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x17.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x17.php @@ -15,5 +15,5 @@ 'ie', 'e', 'ae', 'ai', 'oo', 'au', 'M', 'H', 'a`', '', '', '', 'r', '', '!', '', '', '', '', '', '.', ' // ', ':', '+', '++', ' * ', ' /// ', 'KR', '\'', '[?]', '[?]', '[?]', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x18.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x18.php index 4abbb2cf9..ce8f4832c 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x18.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x18.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1e.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1e.php index ddb0ddd96..d35884f73 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1e.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1e.php @@ -15,5 +15,5 @@ 'E', 'e', 'E', 'e', 'E', 'e', 'E', 'e', 'I', 'i', 'I', 'i', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'O', 'o', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', 'U', 'u', -'U', 'u', 'Y', 'y', 'Y', 'y', 'Y', 'y', 'Y', 'y', '[?]', '[?]', '[?]', '[?]', '[?]', +'U', 'u', 'Y', 'y', 'Y', 'y', 'Y', 'y', 'Y', 'y', 'LL', 'll', 'V', 'v', 'Y', 'y', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1f.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1f.php index 1514055d4..e37996c5b 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1f.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x1f.php @@ -15,5 +15,5 @@ '~', '"~', 'e', 'e', 'e', '[?]', 'e', 'e', 'E', 'E', 'E', 'E', 'E', '\'`', '\'\'', '\'~', 'i', 'i', 'i', 'i', '[?]', '[?]', 'i', 'i', 'I', 'I', 'I', 'I', '[?]', '`\'', '`\'', '`~', 'u', 'u', 'u', 'u', 'R', 'R', 'u', 'u', 'U', 'U', 'U', 'U', 'R', '"`', '"\'', '`', -'[?]', '[?]', 'o', 'o', 'o', '[?]', 'o', 'o', 'O', 'O', 'O', 'O', 'O', '\'', '`', +'[?]', '[?]', 'o', 'o', 'o', '[?]', 'o', 'o', 'O', 'O', 'O', 'O', 'O', '\'', '`', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x20.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x20.php index 55723146a..128687623 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x20.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x20.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x21.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x21.php index 281989ac9..045762b08 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x21.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x21.php @@ -15,5 +15,5 @@ '-', '-', '|', '|', '=', '|', '=', '=', '|', '=', '|', '=', '=', '=', '=', '=', '=', '|', '=', '|', '=', '|', '\\', '/', '\\', '/', '=', '=', '~', '~', '|', '|', '-', '|', '-', '|', '-', '-', '-', '|', '-', '|', '|', '|', '|', '|', '|', '|', -'-', '\\', '\\', '|', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'-', '\\', '\\', '|', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x24.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x24.php index 55b0e0d2b..4598e7b38 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x24.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x24.php @@ -15,5 +15,5 @@ '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x25.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x25.php index 7ff5120d3..90f3f3ec1 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x25.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x25.php @@ -15,5 +15,5 @@ '<', '<', '<', '<', '<', '<', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '*', '#', '#', '#', '#', '#', '^', '^', '^', 'O', -'#', '#', '#', '#', '#', '#', '#', '#', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'#', '#', '#', '#', 'O', 'O', 'O', 'O', '/', '\\\\', '\\\\', '#', '#', '#', '#', '/', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x26.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x26.php index a64a3eabd..8fde2e134 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x26.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x26.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x27.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x27.php index f99462def..014b26da4 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x27.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x27.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x30.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x30.php index 86201c180..f8c13c4e6 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x30.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x30.php @@ -15,5 +15,5 @@ 'da', 'ti', 'di', 'tu', 'tu', 'du', 'te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'ba', 'pa', 'hi', 'bi', 'pi', 'hu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'ya', 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa', -'wi', 'we', 'wo', 'n', 'vu', 'ka', 'ke', 'va', 'vi', 've', 'vo', '', '', '"', '"', +'wi', 'we', 'wo', 'n', 'vu', 'ka', 'ke', 'va', 'vi', 've', 'vo', '', '', '"', '"', 'koto', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x31.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x31.php index 45c827e60..81e1cf07a 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x31.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x31.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x32.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x32.php index 567b92ddd..4f9b95971 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x32.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x32.php @@ -15,5 +15,5 @@ '1M', '2M', '3M', '4M', '5M', '6M', '7M', '8M', '9M', '10M', '11M', '12M', '[?]', '[?]', '[?]', '[?]', 'a', 'i', 'u', 'u', 'o', 'ka', 'ki', 'ku', 'ke', 'ko', 'sa', 'si', 'su', 'se', 'so', 'ta', 'ti', 'tu', 'te', 'to', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'hi', 'hu', 'he', 'ho', 'ma', 'mi', -'mu', 'me', 'mo', 'ya', 'yu', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wi', 'we', 'wo', +'mu', 'me', 'mo', 'ya', 'yu', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wi', 'we', 'wo', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x33.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x33.php index 15095c16b..acb1ac4fb 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x33.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x33.php @@ -15,5 +15,5 @@ 'kOhm', 'MOhm', 'a.m.', 'Bq', 'cc', 'cd', 'C/kg', 'Co.', 'dB', 'Gy', 'ha', 'HP', 'in', 'K.K.', 'KM', 'kt', 'lm', 'ln', 'log', 'lx', 'mb', 'mil', 'mol', 'pH', 'p.m.', 'PPM', 'PR', 'sr', 'Sv', 'Wb', '[?]', '[?]', '1d', '2d', '3d', '4d', '5d', '6d', '7d', '8d', '9d', '10d', '11d', '12d', '13d', '14d', '15d', '16d', -'17d', '18d', '19d', '20d', '21d', '22d', '23d', '24d', '25d', '26d', '27d', '28d', '29d', '30d', '31d', +'17d', '18d', '19d', '20d', '21d', '22d', '23d', '24d', '25d', '26d', '27d', '28d', '29d', '30d', '31d', 'gal', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x9f.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x9f.php index 5a909ff1f..02bf53e6b 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x9f.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/x9f.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xa4.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xa4.php index 1c0ee13d7..8cd3f4946 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xa4.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xa4.php @@ -15,5 +15,5 @@ 'Shat', '[?]', 'Shop', 'Che', 'Zziet', '[?]', 'Ke', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xd7.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xd7.php index 32735ec7d..18282062d 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xd7.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xd7.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfa.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfa.php index b500f6cdb..9150bf565 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfa.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfa.php @@ -15,5 +15,5 @@ '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', +'[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', ); diff --git a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfd.php b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfd.php index ee0fca979..1e988e238 100644 --- a/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfd.php +++ b/tests/integration/vendor/behat/transliterator/src/Behat/Transliterator/data/xfd.php @@ -15,5 +15,5 @@ '', '', '', '', '', '', '', '', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', '[?]', -'', '', '', '', '', '', '', '', '', '', '', '', '[?]', '[?]', '[?]', +'{Salla}', '{Qala}', 'Allah', 'Akbar', 'Mohammed', 'SL`M', 'Rasul', '{Alayhi}', '{WaSallam}', '{Salla}', '{Salla Llahu Alayhi WaSallam}', '{Jalla Jalalahu}', 'Rial ', '{Bismillah Ar-Rahman Ar-Rahimi}', '[?]', '[?]', ); diff --git a/tests/integration/vendor/bin/behat b/tests/integration/vendor/bin/behat index 084f2c9d3..c4503dea5 100755 --- a/tests/integration/vendor/bin/behat +++ b/tests/integration/vendor/bin/behat @@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) { return $operation ? flock($this->handle, $operation) : true; } + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + public function stream_tell() { return $this->position; @@ -98,10 +108,12 @@ if (PHP_VERSION_ID < 80000) { } } - if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/behat/behat/bin/behat'); - exit(0); + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/behat/behat/bin/behat'); } } -include __DIR__ . '/..'.'/behat/behat/bin/behat'; +return include __DIR__ . '/..'.'/behat/behat/bin/behat'; diff --git a/tests/integration/vendor/bin/yaml-lint b/tests/integration/vendor/bin/yaml-lint index a7061e388..388092f5b 100755 --- a/tests/integration/vendor/bin/yaml-lint +++ b/tests/integration/vendor/bin/yaml-lint @@ -66,6 +66,16 @@ if (PHP_VERSION_ID < 80000) { return $operation ? flock($this->handle, $operation) : true; } + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + public function stream_tell() { return $this->position; @@ -98,10 +108,12 @@ if (PHP_VERSION_ID < 80000) { } } - if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { - include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); - exit(0); + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'); } } -include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; +return include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint'; diff --git a/tests/integration/vendor/composer/ClassLoader.php b/tests/integration/vendor/composer/ClassLoader.php index afef3fa2a..7824d8f7e 100644 --- a/tests/integration/vendor/composer/ClassLoader.php +++ b/tests/integration/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -121,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @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); + } } diff --git a/tests/integration/vendor/composer/InstalledVersions.php b/tests/integration/vendor/composer/InstalledVersions.php index d50e0c9fc..51e734a77 100644 --- a/tests/integration/vendor/composer/InstalledVersions.php +++ b/tests/integration/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ * 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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|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 */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -96,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -117,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -241,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: 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} */ public static function getRawData() { @@ -278,7 +280,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() { @@ -301,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @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 + * @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 */ public static function reload($data) { @@ -311,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -326,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $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; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -338,12 +342,17 @@ 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') { - self::$installed = require __DIR__ . '/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 __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/tests/integration/vendor/composer/autoload_classmap.php b/tests/integration/vendor/composer/autoload_classmap.php index 087401551..ac6b3995c 100644 --- a/tests/integration/vendor/composer/autoload_classmap.php +++ b/tests/integration/vendor/composer/autoload_classmap.php @@ -2,11 +2,12 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', diff --git a/tests/integration/vendor/composer/autoload_files.php b/tests/integration/vendor/composer/autoload_files.php index 77d1f8dc7..35fa6bbc5 100644 --- a/tests/integration/vendor/composer/autoload_files.php +++ b/tests/integration/vendor/composer/autoload_files.php @@ -2,7 +2,7 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( @@ -10,13 +10,12 @@ '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 'a1105708a18b76903365ca1c4aa61b02' => $vendorDir . '/symfony/translation/Resources/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', ); diff --git a/tests/integration/vendor/composer/autoload_namespaces.php b/tests/integration/vendor/composer/autoload_namespaces.php index 4e4604cf7..aa95df07b 100644 --- a/tests/integration/vendor/composer/autoload_namespaces.php +++ b/tests/integration/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/tests/integration/vendor/composer/autoload_psr4.php b/tests/integration/vendor/composer/autoload_psr4.php index 983d81b6d..ab84e0fda 100644 --- a/tests/integration/vendor/composer/autoload_psr4.php +++ b/tests/integration/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/tests/integration/vendor/composer/autoload_real.php b/tests/integration/vendor/composer/autoload_real.php index 3f6da5899..909277b27 100644 --- a/tests/integration/vendor/composer/autoload_real.php +++ b/tests/integration/vendor/composer/autoload_real.php @@ -25,56 +25,26 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInit2b078a63e93bc9e9825cefae96ca1eb3', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInit2b078a63e93bc9e9825cefae96ca1eb3', 'loadClassLoader')); - $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'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire2b078a63e93bc9e9825cefae96ca1eb3($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequire2b078a63e93bc9e9825cefae96ca1eb3($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/tests/integration/vendor/composer/autoload_static.php b/tests/integration/vendor/composer/autoload_static.php index 4f9f3e4e8..a8f75f370 100644 --- a/tests/integration/vendor/composer/autoload_static.php +++ b/tests/integration/vendor/composer/autoload_static.php @@ -11,13 +11,12 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3 '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', + '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 'a1105708a18b76903365ca1c4aa61b02' => __DIR__ . '/..' . '/symfony/translation/Resources/functions.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', ); @@ -203,6 +202,7 @@ class ComposerStaticInit2b078a63e93bc9e9825cefae96ca1eb3 public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', diff --git a/tests/integration/vendor/composer/installed.json b/tests/integration/vendor/composer/installed.json index 7df4ff526..4440e9914 100644 --- a/tests/integration/vendor/composer/installed.json +++ b/tests/integration/vendor/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "behat/behat", - "version": "v3.10.0", - "version_normalized": "3.10.0.0", + "version": "v3.13.0", + "version_normalized": "3.13.0.0", "source": { "type": "git", "url": "https://github.com/Behat/Behat.git", - "reference": "a55661154079cf881ef643b303bfaf67bae3a09f" + "reference": "9dd7cdb309e464ddeab095cd1a5151c2dccba4ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Behat/zipball/a55661154079cf881ef643b303bfaf67bae3a09f", - "reference": "a55661154079cf881ef643b303bfaf67bae3a09f", + "url": "https://api.github.com/repos/Behat/Behat/zipball/9dd7cdb309e464ddeab095cd1a5151c2dccba4ab", + "reference": "9dd7cdb309e464ddeab095cd1a5151c2dccba4ab", "shasum": "" }, "require": { @@ -20,7 +20,7 @@ "behat/transliterator": "^1.2", "ext-mbstring": "*", "php": "^7.2 || ^8.0", - "psr/container": "^1.0", + "psr/container": "^1.0 || ^2.0", "symfony/config": "^4.4 || ^5.0 || ^6.0", "symfony/console": "^4.4 || ^5.0 || ^6.0", "symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0", @@ -29,8 +29,8 @@ "symfony/yaml": "^4.4 || ^5.0 || ^6.0" }, "require-dev": { - "container-interop/container-interop": "^1.2", "herrera-io/box": "~1.6.1", + "phpspec/prophecy": "^1.15", "phpunit/phpunit": "^8.5 || ^9.0", "symfony/process": "^4.4 || ^5.0 || ^6.0", "vimeo/psalm": "^4.8" @@ -38,7 +38,7 @@ "suggest": { "ext-dom": "Needed to output test results in JUnit format." }, - "time": "2021-11-02T20:09:40+00:00", + "time": "2023-04-18T15:40:53+00:00", "bin": [ "bin/behat" ], @@ -86,7 +86,7 @@ ], "support": { "issues": "https://github.com/Behat/Behat/issues", - "source": "https://github.com/Behat/Behat/tree/v3.10.0" + "source": "https://github.com/Behat/Behat/tree/v3.13.0" }, "install-path": "../behat/behat" }, @@ -158,32 +158,32 @@ }, { "name": "behat/transliterator", - "version": "v1.3.0", - "version_normalized": "1.3.0.0", + "version": "v1.5.0", + "version_normalized": "1.5.0.0", "source": { "type": "git", "url": "https://github.com/Behat/Transliterator.git", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc" + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Transliterator/zipball/3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", - "reference": "3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc", + "url": "https://api.github.com/repos/Behat/Transliterator/zipball/baac5873bac3749887d28ab68e2f74db3a4408af", + "reference": "baac5873bac3749887d28ab68e2f74db3a4408af", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "require-dev": { "chuyskywalker/rolling-curl": "^3.1", "php-yaoi/php-yaoi": "^1.0", - "phpunit/phpunit": "^4.8.36|^6.3" + "phpunit/phpunit": "^8.5.25 || ^9.5.19" }, - "time": "2020-01-14T16:39:13+00:00", + "time": "2022-03-30T09:27:43+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.x-dev" } }, "installation-source": "dist", @@ -202,27 +202,31 @@ "slug", "transliterator" ], + "support": { + "issues": "https://github.com/Behat/Transliterator/issues", + "source": "https://github.com/Behat/Transliterator/tree/v1.5.0" + }, "install-path": "../behat/transliterator" }, { "name": "guzzlehttp/guzzle", - "version": "7.4.1", - "version_normalized": "7.4.1.0", + "version": "7.8.0", + "version_normalized": "7.8.0.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ee0a041b1760e6a53d2a39c8c34115adc2af2c79", - "reference": "ee0a041b1760e6a53d2a39c8c34115adc2af2c79", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -231,10 +235,11 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -242,11 +247,12 @@ "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, - "time": "2021-12-06T18:43:05+00:00", + "time": "2023-08-27T10:20:53+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "7.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "installation-source": "dist", @@ -313,7 +319,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.4.1" + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" }, "funding": [ { @@ -333,37 +339,36 @@ }, { "name": "guzzlehttp/promises", - "version": "1.5.1", - "version_normalized": "1.5.1.0", + "version": "2.0.1", + "version_normalized": "2.0.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, - "time": "2021-10-22T20:56:57+00:00", + "time": "2023-08-03T15:11:55+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "installation-source": "dist", "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -400,7 +405,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.1" + "source": "https://github.com/guzzle/promises/tree/2.0.1" }, "funding": [ { @@ -420,23 +425,23 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.1.0", - "version_normalized": "2.1.0.0", + "version": "2.6.1", + "version_normalized": "2.6.1.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/089edd38f5b8abba6cb01567c2a8aaa47cec4c72", - "reference": "089edd38f5b8abba6cb01567c2a8aaa47cec4c72", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -444,18 +449,19 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, - "time": "2021-10-06T17:43:30+00:00", + "time": "2023-08-27T10:13:57+00:00", "type": "library", "extra": { - "branch-alias": { - "dev-master": "2.1-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "installation-source": "dist", @@ -518,7 +524,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.1.0" + "source": "https://github.com/guzzle/psr7/tree/2.6.1" }, "funding": [ { @@ -643,24 +649,24 @@ }, { "name": "psr/http-client", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.3", + "version_normalized": "1.0.3.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", - "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "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" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2020-06-29T06:28:15+00:00", + "time": "2023-09-23T14:17:50+00:00", "type": "library", "extra": { "branch-alias": { @@ -680,7 +686,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP clients", @@ -691,28 +697,31 @@ "psr", "psr-18" ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, "install-path": "../psr/http-client" }, { "name": "psr/http-factory", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "1.0.2", + "version_normalized": "1.0.2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be" + "reference": "e616d01114759c4c489f93b099585439f795fe35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", "shasum": "" }, "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, - "time": "2019-04-30T12:38:16+00:00", + "time": "2023-04-10T20:10:41+00:00", "type": "library", "extra": { "branch-alias": { @@ -732,7 +741,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interfaces for PSR-7 HTTP message factories", @@ -747,33 +756,33 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/master" + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" }, "install-path": "../psr/http-factory" }, { "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "2.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, - "time": "2016-08-06T14:39:51+00:00", + "time": "2023-04-04T09:54:51+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -789,7 +798,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -802,6 +811,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, "install-path": "../psr/http-message" }, { @@ -849,17 +861,17 @@ }, { "name": "symfony/config", - "version": "v5.4.3", - "version_normalized": "5.4.3.0", + "version": "v5.4.26", + "version_normalized": "5.4.26.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f" + "reference": "8109892f27beed9252bd1f1c1880aeb4ad842650" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/d65e1bd990c740e31feb07d2b0927b8d4df9956f", - "reference": "d65e1bd990c740e31feb07d2b0927b8d4df9956f", + "url": "https://api.github.com/repos/symfony/config/zipball/8109892f27beed9252bd1f1c1880aeb4ad842650", + "reference": "8109892f27beed9252bd1f1c1880aeb4ad842650", "shasum": "" }, "require": { @@ -883,7 +895,7 @@ "suggest": { "symfony/yaml": "To use the yaml reference dumper" }, - "time": "2022-01-03T09:50:52+00:00", + "time": "2023-07-19T20:21:11+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -911,7 +923,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v5.4.3" + "source": "https://github.com/symfony/config/tree/v5.4.26" }, "funding": [ { @@ -931,17 +943,17 @@ }, { "name": "symfony/console", - "version": "v5.4.5", - "version_normalized": "5.4.5.0", + "version": "v5.4.28", + "version_normalized": "5.4.28.0", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/d8111acc99876953f52fe16d4c50eb60940d49ad", - "reference": "d8111acc99876953f52fe16d4c50eb60940d49ad", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -979,7 +991,7 @@ "symfony/lock": "", "symfony/process": "" }, - "time": "2022-02-24T12:45:35+00:00", + "time": "2023-08-07T06:12:30+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1008,12 +1020,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.5" + "source": "https://github.com/symfony/console/tree/v5.4.28" }, "funding": [ { @@ -1123,23 +1135,23 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", + "version": "v2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8", - "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-07-12T14:48:14+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "extra": { "branch-alias": { @@ -1173,7 +1185,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -1193,17 +1205,17 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.4.3", - "version_normalized": "5.4.3.0", + "version": "v5.4.26", + "version_normalized": "5.4.26.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d" + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/dec8a9f58d20df252b9cd89f1c6c1530f747685d", - "reference": "dec8a9f58d20df252b9cd89f1c6c1530f747685d", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/5dcc00e03413f05c1e7900090927bb7247cb0aac", + "reference": "5dcc00e03413f05c1e7900090927bb7247cb0aac", "shasum": "" }, "require": { @@ -1233,7 +1245,7 @@ "symfony/dependency-injection": "", "symfony/http-kernel": "" }, - "time": "2022-01-02T09:53:40+00:00", + "time": "2023-07-06T06:34:20+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1261,7 +1273,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.3" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.26" }, "funding": [ { @@ -1281,17 +1293,17 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", + "version": "v2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a" + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", - "reference": "66bea3b09be61613cd3b4043a65a8ec48cfa6d2a", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", + "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", "shasum": "" }, "require": { @@ -1301,7 +1313,7 @@ "suggest": { "symfony/event-dispatcher-implementation": "" }, - "time": "2021-07-12T14:48:14+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "extra": { "branch-alias": { @@ -1343,7 +1355,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" }, "funding": [ { @@ -1363,17 +1375,17 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.6", - "version_normalized": "5.4.6.0", + "version": "v5.4.25", + "version_normalized": "5.4.25.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d53a45039974952af7f7ebc461ccdd4295e29440" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d53a45039974952af7f7ebc461ccdd4295e29440", - "reference": "d53a45039974952af7f7ebc461ccdd4295e29440", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -1382,7 +1394,7 @@ "symfony/polyfill-mbstring": "~1.8", "symfony/polyfill-php80": "^1.16" }, - "time": "2022-03-02T12:42:23+00:00", + "time": "2023-05-31T13:04:02+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1410,7 +1422,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.6" + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" }, "funding": [ { @@ -1430,17 +1442,17 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1452,11 +1464,11 @@ "suggest": { "ext-ctype": "For best performance" }, - "time": "2021-10-20T20:35:02+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1495,7 +1507,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" }, "funding": [ { @@ -1515,17 +1527,17 @@ }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/81b86b50cf841a64252b439e738e97f4a34e2783", - "reference": "81b86b50cf841a64252b439e738e97f4a34e2783", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1534,11 +1546,11 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2021-11-23T21:10:46+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1579,7 +1591,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" }, "funding": [ { @@ -1599,17 +1611,17 @@ }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1618,11 +1630,11 @@ "suggest": { "ext-intl": "For best performance" }, - "time": "2021-02-19T12:13:01+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1666,7 +1678,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" }, "funding": [ { @@ -1686,17 +1698,17 @@ }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1708,11 +1720,11 @@ "suggest": { "ext-mbstring": "For best performance" }, - "time": "2021-11-30T18:21:41+00:00", + "time": "2023-07-28T09:04:16+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1752,7 +1764,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" }, "funding": [ { @@ -1772,27 +1784,27 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", - "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-06-05T21:20:04+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1834,7 +1846,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" }, "funding": [ { @@ -1854,27 +1866,27 @@ }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2022-03-04T08:16:47+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1920,7 +1932,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" }, "funding": [ { @@ -1940,27 +1952,27 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.25.0", - "version_normalized": "1.25.0.0", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f" + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", - "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", "shasum": "" }, "require": { "php": ">=7.1" }, - "time": "2021-09-13T13:58:11+00:00", + "time": "2023-01-26T09:26:14+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -2002,7 +2014,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" }, "funding": [ { @@ -2104,17 +2116,17 @@ }, { "name": "symfony/string", - "version": "v5.4.3", - "version_normalized": "5.4.3.0", + "version": "v5.4.26", + "version_normalized": "5.4.26.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10" + "reference": "1181fe9270e373537475e826873b5867b863883c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/92043b7d8383e48104e411bc9434b260dbeb5a10", - "reference": "92043b7d8383e48104e411bc9434b260dbeb5a10", + "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", + "reference": "1181fe9270e373537475e826873b5867b863883c", "shasum": "" }, "require": { @@ -2134,7 +2146,7 @@ "symfony/translation-contracts": "^1.1|^2", "symfony/var-exporter": "^4.4|^5.0|^6.0" }, - "time": "2022-01-02T09:53:40+00:00", + "time": "2023-06-28T12:46:07+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2173,7 +2185,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.3" + "source": "https://github.com/symfony/string/tree/v5.4.26" }, "funding": [ { @@ -2193,17 +2205,17 @@ }, { "name": "symfony/translation", - "version": "v5.4.6", - "version_normalized": "5.4.6.0", + "version": "v5.4.24", + "version_normalized": "5.4.24.0", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b" + "reference": "de237e59c5833422342be67402d487fbf50334ff" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/a7ca9fdfffb0174209440c2ffa1dee228e15d95b", - "reference": "a7ca9fdfffb0174209440c2ffa1dee228e15d95b", + "url": "https://api.github.com/repos/symfony/translation/zipball/de237e59c5833422342be67402d487fbf50334ff", + "reference": "de237e59c5833422342be67402d487fbf50334ff", "shasum": "" }, "require": { @@ -2242,7 +2254,7 @@ "symfony/config": "", "symfony/yaml": "" }, - "time": "2022-03-02T12:56:28+00:00", + "time": "2023-05-19T12:34:17+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -2273,7 +2285,7 @@ "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.6" + "source": "https://github.com/symfony/translation/tree/v5.4.24" }, "funding": [ { @@ -2293,17 +2305,17 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.5.0", - "version_normalized": "2.5.0.0", + "version": "v2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e" + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/d28150f0f44ce854e942b671fc2620a98aae1b1e", - "reference": "d28150f0f44ce854e942b671fc2620a98aae1b1e", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/136b19dd05cdf0709db6537d058bcab6dd6e2dbe", + "reference": "136b19dd05cdf0709db6537d058bcab6dd6e2dbe", "shasum": "" }, "require": { @@ -2312,7 +2324,7 @@ "suggest": { "symfony/translation-implementation": "" }, - "time": "2021-08-17T14:20:01+00:00", + "time": "2022-06-27T16:58:25+00:00", "type": "library", "extra": { "branch-alias": { @@ -2354,7 +2366,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.0" + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" }, "funding": [ { @@ -2374,17 +2386,17 @@ }, { "name": "symfony/yaml", - "version": "v5.4.3", - "version_normalized": "5.4.3.0", + "version": "v5.4.23", + "version_normalized": "5.4.23.0", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2" + "reference": "4cd2e3ea301aadd76a4172756296fe552fb45b0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e80f87d2c9495966768310fc531b487ce64237a2", - "reference": "e80f87d2c9495966768310fc531b487ce64237a2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/4cd2e3ea301aadd76a4172756296fe552fb45b0b", + "reference": "4cd2e3ea301aadd76a4172756296fe552fb45b0b", "shasum": "" }, "require": { @@ -2401,7 +2413,7 @@ "suggest": { "symfony/console": "For validating YAML files using the lint command" }, - "time": "2022-01-26T16:32:32+00:00", + "time": "2023-04-23T19:33:36+00:00", "bin": [ "Resources/bin/yaml-lint" ], @@ -2432,7 +2444,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.3" + "source": "https://github.com/symfony/yaml/tree/v5.4.23" }, "funding": [ { diff --git a/tests/integration/vendor/composer/installed.php b/tests/integration/vendor/composer/installed.php index 8f7263632..12b863977 100644 --- a/tests/integration/vendor/composer/installed.php +++ b/tests/integration/vendor/composer/installed.php @@ -1,85 +1,85 @@ array( + 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '07a942a9bbd5d2f039fa443e74426fffa7732e68', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'cbc480eadc87e4f8dcb722ba76e7fe78903b9e60', - 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', + 'reference' => '07a942a9bbd5d2f039fa443e74426fffa7732e68', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => 'cbc480eadc87e4f8dcb722ba76e7fe78903b9e60', 'dev_requirement' => false, ), 'behat/behat' => array( - 'pretty_version' => 'v3.10.0', - 'version' => '3.10.0.0', + 'pretty_version' => 'v3.13.0', + 'version' => '3.13.0.0', + 'reference' => '9dd7cdb309e464ddeab095cd1a5151c2dccba4ab', 'type' => 'library', 'install_path' => __DIR__ . '/../behat/behat', 'aliases' => array(), - 'reference' => 'a55661154079cf881ef643b303bfaf67bae3a09f', 'dev_requirement' => true, ), 'behat/gherkin' => array( 'pretty_version' => 'v4.9.0', 'version' => '4.9.0.0', + 'reference' => '0bc8d1e30e96183e4f36db9dc79caead300beff4', 'type' => 'library', 'install_path' => __DIR__ . '/../behat/gherkin', 'aliases' => array(), - 'reference' => '0bc8d1e30e96183e4f36db9dc79caead300beff4', 'dev_requirement' => true, ), 'behat/transliterator' => array( - 'pretty_version' => 'v1.3.0', - 'version' => '1.3.0.0', + 'pretty_version' => 'v1.5.0', + 'version' => '1.5.0.0', + 'reference' => 'baac5873bac3749887d28ab68e2f74db3a4408af', 'type' => 'library', 'install_path' => __DIR__ . '/../behat/transliterator', 'aliases' => array(), - 'reference' => '3c4ec1d77c3d05caa1f0bf8fb3aae4845005c7fc', 'dev_requirement' => true, ), 'guzzlehttp/guzzle' => array( - 'pretty_version' => '7.4.1', - 'version' => '7.4.1.0', + 'pretty_version' => '7.8.0', + 'version' => '7.8.0.0', + 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', 'aliases' => array(), - 'reference' => 'ee0a041b1760e6a53d2a39c8c34115adc2af2c79', 'dev_requirement' => true, ), 'guzzlehttp/promises' => array( - 'pretty_version' => '1.5.1', - 'version' => '1.5.1.0', + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/promises', 'aliases' => array(), - 'reference' => 'fe752aedc9fd8fcca3fe7ad05d419d32998a06da', 'dev_requirement' => true, ), 'guzzlehttp/psr7' => array( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', + 'pretty_version' => '2.6.1', + 'version' => '2.6.1.0', + 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', 'type' => 'library', 'install_path' => __DIR__ . '/../guzzlehttp/psr7', 'aliases' => array(), - 'reference' => '089edd38f5b8abba6cb01567c2a8aaa47cec4c72', 'dev_requirement' => true, ), 'psr/container' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', + 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/container', 'aliases' => array(), - 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', 'dev_requirement' => true, ), 'psr/container-implementation' => array( @@ -91,10 +91,10 @@ 'psr/event-dispatcher' => array( 'pretty_version' => '1.0.0', 'version' => '1.0.0.0', + 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/event-dispatcher', 'aliases' => array(), - 'reference' => 'dbefd12671e8a14ec7f180cab83036ed26714bb0', 'dev_requirement' => true, ), 'psr/event-dispatcher-implementation' => array( @@ -104,12 +104,12 @@ ), ), 'psr/http-client' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-client', 'aliases' => array(), - 'reference' => '2dfb5f6c5eff0e91e20e913f8c5452ed95b86621', 'dev_requirement' => true, ), 'psr/http-client-implementation' => array( @@ -119,12 +119,12 @@ ), ), 'psr/http-factory' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), - 'reference' => '12ac7fcd07e5b077433f5f2bee95b3a771bf61be', 'dev_requirement' => true, ), 'psr/http-factory-implementation' => array( @@ -134,12 +134,12 @@ ), ), 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', 'dev_requirement' => true, ), 'psr/http-message-implementation' => array( @@ -157,64 +157,64 @@ '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/config' => array( - 'pretty_version' => 'v5.4.3', - 'version' => '5.4.3.0', + 'pretty_version' => 'v5.4.26', + 'version' => '5.4.26.0', + 'reference' => '8109892f27beed9252bd1f1c1880aeb4ad842650', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/config', 'aliases' => array(), - 'reference' => 'd65e1bd990c740e31feb07d2b0927b8d4df9956f', 'dev_requirement' => true, ), 'symfony/console' => array( - 'pretty_version' => 'v5.4.5', - 'version' => '5.4.5.0', + 'pretty_version' => 'v5.4.28', + 'version' => '5.4.28.0', + 'reference' => 'f4f71842f24c2023b91237c72a365306f3c58827', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/console', 'aliases' => array(), - 'reference' => 'd8111acc99876953f52fe16d4c50eb60940d49ad', 'dev_requirement' => true, ), 'symfony/dependency-injection' => array( 'pretty_version' => 'v5.2.12', 'version' => '5.2.12.0', + 'reference' => '2f0326ab0e142a3600b1b435cb3e852bc96264b6', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/dependency-injection', 'aliases' => array(), - 'reference' => '2f0326ab0e142a3600b1b435cb3e852bc96264b6', 'dev_requirement' => true, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', + 'pretty_version' => 'v2.5.2', + 'version' => '2.5.2.0', + 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), - 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8', 'dev_requirement' => true, ), 'symfony/event-dispatcher' => array( - 'pretty_version' => 'v5.4.3', - 'version' => '5.4.3.0', + 'pretty_version' => 'v5.4.26', + 'version' => '5.4.26.0', + 'reference' => '5dcc00e03413f05c1e7900090927bb7247cb0aac', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher', 'aliases' => array(), - 'reference' => 'dec8a9f58d20df252b9cd89f1c6c1530f747685d', 'dev_requirement' => true, ), 'symfony/event-dispatcher-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', + 'pretty_version' => 'v2.5.2', + 'version' => '2.5.2.0', + 'reference' => 'f98b54df6ad059855739db6fcbc2d36995283fe1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/event-dispatcher-contracts', 'aliases' => array(), - 'reference' => '66bea3b09be61613cd3b4043a65a8ec48cfa6d2a', 'dev_requirement' => true, ), 'symfony/event-dispatcher-implementation' => array( @@ -224,84 +224,84 @@ ), ), 'symfony/filesystem' => array( - 'pretty_version' => 'v5.4.6', - 'version' => '5.4.6.0', + 'pretty_version' => 'v5.4.25', + 'version' => '5.4.25.0', + 'reference' => '0ce3a62c9579a53358d3a7eb6b3dfb79789a6364', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/filesystem', 'aliases' => array(), - 'reference' => 'd53a45039974952af7f7ebc461ccdd4295e29440', 'dev_requirement' => true, ), 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => 'ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', 'aliases' => array(), - 'reference' => '30885182c981ab175d4d034db0f6f469898070ab', 'dev_requirement' => true, ), 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '875e90aeea2777b6f135677f618529449334a612', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', 'aliases' => array(), - 'reference' => '81b86b50cf841a64252b439e738e97f4a34e2783', 'dev_requirement' => true, ), 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', 'aliases' => array(), - 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', 'dev_requirement' => true, ), 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '42292d99c55abe617799667f454222c54c60e229', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', 'aliases' => array(), - 'reference' => '0abb51d2f102e00a4eefcf46ba7fec406d245825', 'dev_requirement' => true, ), 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => 'fe2f306d1d9d346a7fee353d0d5012e401e984b5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php73', 'aliases' => array(), - 'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5', 'dev_requirement' => true, ), 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '6caa57379c4aec19c0a12a38b59b26487dcfe4b5', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php80', 'aliases' => array(), - 'reference' => '4407588e0d3f1f52efb65fbe92babe41f37fe50c', 'dev_requirement' => true, ), 'symfony/polyfill-php81' => array( - 'pretty_version' => 'v1.25.0', - 'version' => '1.25.0.0', + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '7581cd600fa9fd681b797d00b02f068e2f13263b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/polyfill-php81', 'aliases' => array(), - 'reference' => '5de4ba2d41b15f9bd0e19b2ab9674135813ec98f', 'dev_requirement' => true, ), 'symfony/service-contracts' => array( 'pretty_version' => 'v2.2.0', 'version' => '2.2.0.0', + 'reference' => 'd15da7ba4957ffb8f1747218be9e1a121fd298a1', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/service-contracts', 'aliases' => array(), - 'reference' => 'd15da7ba4957ffb8f1747218be9e1a121fd298a1', 'dev_requirement' => true, ), 'symfony/service-implementation' => array( @@ -311,30 +311,30 @@ ), ), 'symfony/string' => array( - 'pretty_version' => 'v5.4.3', - 'version' => '5.4.3.0', + 'pretty_version' => 'v5.4.26', + 'version' => '5.4.26.0', + 'reference' => '1181fe9270e373537475e826873b5867b863883c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/string', 'aliases' => array(), - 'reference' => '92043b7d8383e48104e411bc9434b260dbeb5a10', 'dev_requirement' => true, ), 'symfony/translation' => array( - 'pretty_version' => 'v5.4.6', - 'version' => '5.4.6.0', + 'pretty_version' => 'v5.4.24', + 'version' => '5.4.24.0', + 'reference' => 'de237e59c5833422342be67402d487fbf50334ff', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation', 'aliases' => array(), - 'reference' => 'a7ca9fdfffb0174209440c2ffa1dee228e15d95b', 'dev_requirement' => true, ), 'symfony/translation-contracts' => array( - 'pretty_version' => 'v2.5.0', - 'version' => '2.5.0.0', + 'pretty_version' => 'v2.5.2', + 'version' => '2.5.2.0', + 'reference' => '136b19dd05cdf0709db6537d058bcab6dd6e2dbe', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/translation-contracts', 'aliases' => array(), - 'reference' => 'd28150f0f44ce854e942b671fc2620a98aae1b1e', 'dev_requirement' => true, ), 'symfony/translation-implementation' => array( @@ -344,12 +344,12 @@ ), ), 'symfony/yaml' => array( - 'pretty_version' => 'v5.4.3', - 'version' => '5.4.3.0', + 'pretty_version' => 'v5.4.23', + 'version' => '5.4.23.0', + 'reference' => '4cd2e3ea301aadd76a4172756296fe552fb45b0b', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/yaml', 'aliases' => array(), - 'reference' => 'e80f87d2c9495966768310fc531b487ce64237a2', 'dev_requirement' => true, ), ), diff --git a/tests/integration/vendor/composer/platform_check.php b/tests/integration/vendor/composer/platform_check.php index 92370c5a0..adfb472fb 100644 --- a/tests/integration/vendor/composer/platform_check.php +++ b/tests/integration/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70300)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/tests/integration/vendor/guzzlehttp/guzzle/CHANGELOG.md b/tests/integration/vendor/guzzlehttp/guzzle/CHANGELOG.md index b278efca9..990b86c9e 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/tests/integration/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -2,6 +2,107 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. + +## 7.8.0 - 2023-08-27 + +### Added + +- Support for PHP 8.3 +- Added automatic closing of handles on `CurlFactory` object destruction + + +## 7.7.1 - 2023-08-27 + +### Changed + +- Remove the need for `AllowDynamicProperties` in `CurlMultiHandler` + + +## 7.7.0 - 2023-05-21 + +### Added + +- Support `guzzlehttp/promises` v2 + + +## 7.6.1 - 2023-05-15 + +### Fixed + +- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values + + +## 7.6.0 - 2023-05-14 + +### Added + +- Support for setting the minimum TLS version in a unified way +- Apply on request the version set in options parameters + + +## 7.5.2 - 2023-05-14 + +### Fixed + +- Fixed set cookie constructor validation +- Fixed handling of files with `'0'` body + +### Changed + +- Corrected docs and default connect timeout value to 300 seconds + + +## 7.5.1 - 2023-04-17 + +### Fixed + +- Fixed `NO_PROXY` settings so that setting the `proxy` option to `no` overrides the env variable + +### Changed + +- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5` + + +## 7.5.0 - 2022-08-28 + +### Added + +- Support PHP 8.2 +- Add request to delay closure params + + +## 7.4.5 - 2022-06-20 + +### Fixed + +* Fix change in port should be considered a change in origin +* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin + + +## 7.4.4 - 2022-06-09 + +### Fixed + +* Fix failure to strip Authorization header on HTTP downgrade +* Fix failure to strip the Cookie header on change in host or HTTP downgrade + + +## 7.4.3 - 2022-05-25 + +### Fixed + +* Fix cross-domain cookie leakage + + +## 7.4.2 - 2022-03-20 + +### Fixed + +- Remove curl auth on cross-domain redirects to align with the Authorization HTTP header +- Reject non-HTTP schemes in StreamHandler +- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve` + + ## 7.4.1 - 2021-12-06 ### Changed @@ -13,6 +114,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950) + ## 7.4.0 - 2021-10-18 ### Added @@ -30,6 +132,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945) + ## 7.3.0 - 2021-03-23 ### Added @@ -42,6 +145,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872) + ## 7.2.0 - 2020-10-10 ### Added @@ -64,6 +168,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786) + ## 7.1.1 - 2020-09-30 ### Fixed @@ -75,6 +180,7 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - We dont connect curl `sink` on HEAD requests. - Removed some PHP 5 workarounds + ## 7.1.0 - 2020-09-22 ### Added @@ -97,14 +203,17 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version - `Utils::defaultCaBundle()` - `CurlFactory::LOW_CURL_VERSION_NUMBER` + ## 7.0.1 - 2020-06-27 * Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699) + ## 7.0.0 - 2020-06-27 No changes since 7.0.0-rc1. + ## 7.0.0-rc1 - 2020-06-15 ### Changed @@ -112,6 +221,7 @@ No changes since 7.0.0-rc1. * Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629) * Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675) + ## 7.0.0-beta2 - 2020-05-25 ### Added @@ -137,6 +247,7 @@ No changes since 7.0.0-rc1. * Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528) + ## 7.0.0-beta1 - 2019-12-30 The diff might look very big but 95% of Guzzle users will be able to upgrade without modification. @@ -170,15 +281,18 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440) * Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464) + ## 6.5.2 - 2019-12-23 * idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489) + ## 6.5.1 - 2019-12-21 * Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454) * IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424) + ## 6.5.0 - 2019-12-07 * Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143) @@ -188,11 +302,13 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348) * Deprecated `ClientInterface::VERSION` + ## 6.4.1 - 2019-10-23 * No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that * Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar` + ## 6.4.0 - 2019-10-23 * Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108) @@ -205,6 +321,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335) * Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362) + ## 6.3.3 - 2018-04-22 * Fix: Default headers when decode_content is specified @@ -246,13 +363,14 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684) * Improvement: Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827) - + Minor code cleanups, documentation fixes and clarifications. + ## 6.2.3 - 2017-02-28 * Fix deprecations with guzzle/psr7 version 1.4 + ## 6.2.2 - 2016-10-08 * Allow to pass nullable Response to delay callable @@ -260,6 +378,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Fix drain case where content-length is the literal string zero * Obfuscate in-URL credentials in exceptions + ## 6.2.1 - 2016-07-18 * Address HTTP_PROXY security vulnerability, CVE-2016-5385: @@ -270,6 +389,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c a server does not honor `Connection: close`. * Ignore URI fragment when sending requests. + ## 6.2.0 - 2016-03-21 * Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`. @@ -289,6 +409,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Bug fix: provide an empty string to `http_build_query` for HHVM workaround. https://github.com/guzzle/guzzle/pull/1367 + ## 6.1.1 - 2015-11-22 * Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler @@ -304,6 +425,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Bug fix: fixed regression where MockHandler was not using `sink`. https://github.com/guzzle/guzzle/pull/1292 + ## 6.1.0 - 2015-09-08 * Feature: Added the `on_stats` request option to provide access to transfer @@ -338,6 +460,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set. https://github.com/guzzle/guzzle/pull/1189 + ## 6.0.2 - 2015-07-04 * Fixed a memory leak in the curl handlers in which references to callbacks @@ -355,6 +478,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Functions are now conditionally required using an additional level of indirection to help with global Composer installations. + ## 6.0.1 - 2015-05-27 * Fixed a bug with serializing the `query` request option where the `&` @@ -363,6 +487,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c use `form_params` or `multipart` instead. * Various doc fixes. + ## 6.0.0 - 2015-05-26 * See the UPGRADING.md document for more information. @@ -387,6 +512,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * `$maxHandles` has been removed from CurlMultiHandler. * `MultipartPostBody` is now part of the `guzzlehttp/psr7` package. + ## 5.3.0 - 2015-05-19 * Mock now supports `save_to` @@ -397,6 +523,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated. * URL scheme is now always lowercased. + ## 6.0.0-beta.1 * Requires PHP >= 5.5 @@ -449,6 +576,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * `GuzzleHttp\QueryParser` has been replaced with the `GuzzleHttp\Psr7\parse_query`. + ## 5.2.0 - 2015-01-27 * Added `AppliesHeadersInterface` to make applying headers to a request based @@ -459,6 +587,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c RingBridge. * Added a guard in the Pool class to not use recursion for request retries. + ## 5.1.0 - 2014-12-19 * Pool class no longer uses recursion when a request is intercepted. @@ -479,6 +608,7 @@ Please see [the upgrade document](UPGRADING.md) that describes all BC breaking c * Exceptions thrown in the `end` event are now correctly wrapped with Guzzle specific exceptions if necessary. + ## 5.0.3 - 2014-11-03 This change updates query strings so that they are treated as un-encoded values @@ -493,6 +623,7 @@ string that should not be parsed or encoded (unless a call to getQuery() is subsequently made, forcing the query-string to be converted into a Query object). + ## 5.0.2 - 2014-10-30 * Added a trailing `\r\n` to multipart/form-data payloads. See @@ -514,6 +645,7 @@ object). string on a URL: Now allowing many more characters to be present in the query string without being percent encoded. See https://tools.ietf.org/html/rfc3986#appendix-A + ## 5.0.1 - 2014-10-16 Bugfix release. @@ -525,6 +657,7 @@ Bugfix release. * Fixed an issue where transfer statistics were not being populated in the RingBridge. https://github.com/guzzle/guzzle/issues/866 + ## 5.0.0 - 2014-10-12 Adding support for non-blocking responses and some minor API cleanup. @@ -606,6 +739,7 @@ interfaces. argument. They now accept an associative array of options, including the "size" key and "metadata" key which can be used to provide custom metadata. + ## 4.2.2 - 2014-09-08 * Fixed a memory leak in the CurlAdapter when reusing cURL handles. diff --git a/tests/integration/vendor/guzzlehttp/guzzle/README.md b/tests/integration/vendor/guzzlehttp/guzzle/README.md index 0025aa7a1..0786462b3 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/README.md +++ b/tests/integration/vendor/guzzlehttp/guzzle/README.md @@ -42,9 +42,9 @@ $promise->wait(); We use GitHub issues only to discuss bugs and new features. For support please refer to: -- [Documentation](http://guzzlephp.org/) -- [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) -- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](http://slack.httplug.io/) +- [Documentation](https://docs.guzzlephp.org) +- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle) +- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/) - [Gitter](https://gitter.im/guzzle/guzzle) @@ -60,23 +60,23 @@ composer require guzzlehttp/guzzle ## Version Guidance -| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | -|---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| -| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | -| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | -| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | -| 6.x | Security fixes | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | -| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >= 7.2 | +| Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | +|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------| +| 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >=5.3.3,<7.0 | +| 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >=5.4,<7.0 | +| 5.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >=5.4,<7.4 | +| 6.x | Security fixes only | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >=5.5,<8.0 | +| 7.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes | >=7.2.5,<8.3 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x [guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 [guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5 [guzzle-7-repo]: https://github.com/guzzle/guzzle -[guzzle-3-docs]: http://guzzle3.readthedocs.org -[guzzle-5-docs]: http://docs.guzzlephp.org/en/5.3/ -[guzzle-6-docs]: http://docs.guzzlephp.org/en/6.5/ -[guzzle-7-docs]: http://docs.guzzlephp.org/en/latest/ +[guzzle-3-docs]: https://guzzle3.readthedocs.io/ +[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/ +[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/ +[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/ ## Security diff --git a/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md b/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md index 45417a7e1..8fa0afb5d 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md +++ b/tests/integration/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -27,7 +27,7 @@ Please make sure: - Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. - Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. -- Request option `exception` is removed. Please use `http_errors`. +- Request option `exceptions` is removed. Please use `http_errors`. - Request option `save_to` is removed. Please use `sink`. - Pool option `pool_size` is removed. Please use `concurrency`. - We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. diff --git a/tests/integration/vendor/guzzlehttp/guzzle/composer.json b/tests/integration/vendor/guzzlehttp/guzzle/composer.json index 2549f78b2..72defd614 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/composer.json +++ b/tests/integration/vendor/guzzlehttp/guzzle/composer.json @@ -53,8 +53,8 @@ "require": { "php": "^7.2.5 || ^8.0", "ext-json": "*", - "guzzlehttp/promises": "^1.5", - "guzzlehttp/psr7": "^1.8.3 || ^2.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" }, @@ -63,9 +63,10 @@ }, "require-dev": { "ext-curl": "*", - "bamarni/composer-bin-plugin": "^1.4.1", - "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "bamarni/composer-bin-plugin": "^1.8.1", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -74,12 +75,16 @@ "psr/log": "Required for using the Log middleware" }, "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, "preferred-install": "dist", "sort-packages": true }, "extra": { - "branch-alias": { - "dev-master": "7.4-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Client.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Client.php index 58f1d891a..bc6efc90f 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Client.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Client.php @@ -120,13 +120,14 @@ public function sendAsync(RequestInterface $request, array $options = []): Promi public function send(RequestInterface $request, array $options = []): ResponseInterface { $options[RequestOptions::SYNCHRONOUS] = true; + return $this->sendAsync($request, $options)->wait(); } /** * The HttpClient PSR (PSR-18) specify this method. * - * @inheritDoc + * {@inheritDoc} */ public function sendRequest(RequestInterface $request): ResponseInterface { @@ -184,6 +185,7 @@ public function requestAsync(string $method, $uri = '', array $options = []): Pr public function request(string $method, $uri = '', array $options = []): ResponseInterface { $options[RequestOptions::SYNCHRONOUS] = true; + return $this->requestAsync($method, $uri, $options)->wait(); } @@ -200,7 +202,7 @@ public function request(string $method, $uri = '', array $options = []): Respons * * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(?string $option = null) + public function getConfig(string $option = null) { return $option === null ? $this->config @@ -228,11 +230,11 @@ private function configureDefaults(array $config): void { $defaults = [ 'allow_redirects' => RedirectMiddleware::$defaultSettings, - 'http_errors' => true, - 'decode_content' => true, - 'verify' => true, - 'cookies' => false, - 'idn_conversion' => false, + 'http_errors' => true, + 'decode_content' => true, + 'verify' => true, + 'cookies' => false, + 'idn_conversion' => false, ]; // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. @@ -354,10 +356,10 @@ private function applyOptions(RequestInterface $request, array &$options): Reque if (isset($options['form_params'])) { if (isset($options['multipart'])) { throw new InvalidArgumentException('You cannot use ' - . 'form_params and multipart at the same time. Use the ' - . 'form_params option if you want to send application/' - . 'x-www-form-urlencoded requests, and the multipart ' - . 'option to send multipart/form-data requests.'); + .'form_params and multipart at the same time. Use the ' + .'form_params option if you want to send application/' + .'x-www-form-urlencoded requests, and the multipart ' + .'option to send multipart/form-data requests.'); } $options['body'] = \http_build_query($options['form_params'], '', '&'); unset($options['form_params']); @@ -403,7 +405,7 @@ private function applyOptions(RequestInterface $request, array &$options): Reque // Ensure that we don't have the header in different case and set the new value. $modify['set_headers'] = Psr7\Utils::caselessRemove(['Authorization'], $modify['set_headers']); $modify['set_headers']['Authorization'] = 'Basic ' - . \base64_encode("$value[0]:$value[1]"); + .\base64_encode("$value[0]:$value[1]"); break; case 'digest': // @todo: Do not rely on curl @@ -437,13 +439,17 @@ private function applyOptions(RequestInterface $request, array &$options): Reque } } + if (isset($options['version'])) { + $modify['version'] = $options['version']; + } + $request = Psr7\Utils::modifyRequest($request, $modify); if ($request->getBody() instanceof Psr7\MultipartStream) { // Use a multipart/form-data POST if a Content-Type is not set. // Ensure that we don't have the header in different case and set the new value. $options['_conditional'] = Psr7\Utils::caselessRemove(['Content-Type'], $options['_conditional']); $options['_conditional']['Content-Type'] = 'multipart/form-data; boundary=' - . $request->getBody()->getBoundary(); + .$request->getBody()->getBoundary(); } // Merge in conditional headers if they are not present. @@ -469,9 +475,9 @@ private function applyOptions(RequestInterface $request, array &$options): Reque private function invalidBody(): InvalidArgumentException { return new InvalidArgumentException('Passing in the "body" request ' - . 'option as an array to send a request is not supported. ' - . 'Please use the "form_params" request option to send a ' - . 'application/x-www-form-urlencoded request, or the "multipart" ' - . 'request option to send a multipart/form-data request.'); + .'option as an array to send a request is not supported. ' + .'Please use the "form_params" request option to send a ' + .'application/x-www-form-urlencoded request, or the "multipart" ' + .'request option to send a multipart/form-data request.'); } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 6aaee61af..1788e16ab 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -80,5 +80,5 @@ public function requestAsync(string $method, $uri, array $options = []): Promise * * @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(?string $option = null); + public function getConfig(string $option = null); } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php index d6757c654..fa2b10a8c 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -50,10 +50,10 @@ public static function fromArray(array $cookies, string $domain): self $cookieJar = new self(); foreach ($cookies as $name => $value) { $cookieJar->setCookie(new SetCookie([ - 'Domain' => $domain, - 'Name' => $name, - 'Value' => $value, - 'Discard' => true + 'Domain' => $domain, + 'Name' => $name, + 'Value' => $value, + 'Discard' => true, ])); } @@ -96,9 +96,6 @@ public function getCookieByName(string $name): ?SetCookie return null; } - /** - * @inheritDoc - */ public function toArray(): array { return \array_map(static function (SetCookie $cookie): array { @@ -106,13 +103,11 @@ public function toArray(): array }, $this->getIterator()->getArrayCopy()); } - /** - * @inheritDoc - */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void + public function clear(string $domain = null, string $path = null, string $name = null): void { if (!$domain) { $this->cookies = []; + return; } elseif (!$path) { $this->cookies = \array_filter( @@ -125,25 +120,22 @@ static function (SetCookie $cookie) use ($domain): bool { $this->cookies = \array_filter( $this->cookies, static function (SetCookie $cookie) use ($path, $domain): bool { - return !($cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); + return !($cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); } ); } else { $this->cookies = \array_filter( $this->cookies, static function (SetCookie $cookie) use ($path, $domain, $name) { - return !($cookie->getName() == $name && - $cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); + return !($cookie->getName() == $name + && $cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); } ); } } - /** - * @inheritDoc - */ public function clearSessionCookies(): void { $this->cookies = \array_filter( @@ -154,9 +146,6 @@ static function (SetCookie $cookie): bool { ); } - /** - * @inheritDoc - */ public function setCookie(SetCookie $cookie): bool { // If the name string is empty (but not 0), ignore the set-cookie @@ -170,20 +159,20 @@ public function setCookie(SetCookie $cookie): bool $result = $cookie->validate(); if ($result !== true) { if ($this->strictMode) { - throw new \RuntimeException('Invalid cookie: ' . $result); + throw new \RuntimeException('Invalid cookie: '.$result); } $this->removeCookieIfEmpty($cookie); + return false; } // Resolve conflicts with previously set cookies foreach ($this->cookies as $i => $c) { - // Two cookies are identical, when their path, and domain are // identical. - if ($c->getPath() != $cookie->getPath() || - $c->getDomain() != $cookie->getDomain() || - $c->getName() != $cookie->getName() + if ($c->getPath() != $cookie->getPath() + || $c->getDomain() != $cookie->getDomain() + || $c->getName() != $cookie->getName() ) { continue; } @@ -241,6 +230,11 @@ public function extractCookies(RequestInterface $request, ResponseInterface $res if (0 !== \strpos($sc->getPath(), '/')) { $sc->setPath($this->getCookiePathFromRequest($request)); } + if (!$sc->matchesDomain($request->getUri()->getHost())) { + continue; + } + // Note: At this point `$sc->getDomain()` being a public suffix should + // be rejected, but we don't want to pull in the full PSL dependency. $this->setCookie($sc); } } @@ -249,7 +243,7 @@ public function extractCookies(RequestInterface $request, ResponseInterface $res /** * Computes cookie path following RFC 6265 section 5.1.4 * - * @link https://tools.ietf.org/html/rfc6265#section-5.1.4 + * @see https://tools.ietf.org/html/rfc6265#section-5.1.4 */ private function getCookiePathFromRequest(RequestInterface $request): string { @@ -280,13 +274,13 @@ public function withCookieHeader(RequestInterface $request): RequestInterface $path = $uri->getPath() ?: '/'; foreach ($this->cookies as $cookie) { - if ($cookie->matchesPath($path) && - $cookie->matchesDomain($host) && - !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme === 'https') + if ($cookie->matchesPath($path) + && $cookie->matchesDomain($host) + && !$cookie->isExpired() + && (!$cookie->getSecure() || $scheme === 'https') ) { - $values[] = $cookie->getName() . '=' - . $cookie->getValue(); + $values[] = $cookie->getName().'=' + .$cookie->getValue(); } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php index 7df374b5b..8c55cc6f7 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -13,7 +13,8 @@ * necessary. Subclasses are also responsible for storing and retrieving * cookies from a file, database, etc. * - * @link https://docs.python.org/2/library/cookielib.html Inspiration + * @see https://docs.python.org/2/library/cookielib.html Inspiration + * * @extends \IteratorAggregate */ interface CookieJarInterface extends \Countable, \IteratorAggregate @@ -61,7 +62,7 @@ public function setCookie(SetCookie $cookie): bool; * @param string|null $path Clears cookies matching a domain and path * @param string|null $name Clears cookies matching a domain, path, and name */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; + public function clear(string $domain = null, string $path = null, string $name = null): void; /** * Discard all sessions cookies. diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php index 5d51ca982..cb3e67c6a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php @@ -71,7 +71,7 @@ protected function load(): void $this->setCookie(new SetCookie($cookie)); } } elseif (\strlen($data)) { - throw new \RuntimeException("Invalid cookie data"); + throw new \RuntimeException('Invalid cookie data'); } } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php index 7c04034d2..d74915bed 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php @@ -11,15 +11,15 @@ class SetCookie * @var array */ private static $defaults = [ - 'Name' => null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false + 'Name' => null, + 'Value' => null, + 'Domain' => null, + 'Path' => '/', + 'Max-Age' => null, + 'Expires' => null, + 'Secure' => false, + 'Discard' => false, + 'HttpOnly' => false, ]; /** @@ -58,7 +58,13 @@ public static function fromString(string $cookie): self } else { foreach (\array_keys(self::$defaults) as $search) { if (!\strcasecmp($search, $key)) { - $data[$search] = $value; + if ($search === 'Max-Age') { + if (is_numeric($value)) { + $data[$search] = (int) $value; + } + } else { + $data[$search] = $value; + } continue 2; } } @@ -74,13 +80,49 @@ public static function fromString(string $cookie): self */ public function __construct(array $data = []) { - /** @var array|null $replaced will be null in case of replace error */ - $replaced = \array_replace(self::$defaults, $data); - if ($replaced === null) { - throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.'); + $this->data = self::$defaults; + + if (isset($data['Name'])) { + $this->setName($data['Name']); + } + + if (isset($data['Value'])) { + $this->setValue($data['Value']); + } + + if (isset($data['Domain'])) { + $this->setDomain($data['Domain']); + } + + if (isset($data['Path'])) { + $this->setPath($data['Path']); + } + + if (isset($data['Max-Age'])) { + $this->setMaxAge($data['Max-Age']); + } + + if (isset($data['Expires'])) { + $this->setExpires($data['Expires']); + } + + if (isset($data['Secure'])) { + $this->setSecure($data['Secure']); + } + + if (isset($data['Discard'])) { + $this->setDiscard($data['Discard']); + } + + if (isset($data['HttpOnly'])) { + $this->setHttpOnly($data['HttpOnly']); + } + + // Set the remaining values that don't have extra validation logic + foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) { + $this->data[$key] = $data[$key]; } - $this->data = $replaced; // Extract the Expires value and turn it into a UNIX timestamp if needed if (!$this->getExpires() && $this->getMaxAge()) { // Calculate the Expires date @@ -92,13 +134,13 @@ public function __construct(array $data = []) public function __toString() { - $str = $this->data['Name'] . '=' . ($this->data['Value'] ?? '') . '; '; + $str = $this->data['Name'].'='.($this->data['Value'] ?? '').'; '; foreach ($this->data as $k => $v) { if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) { if ($k === 'Expires') { - $str .= 'Expires=' . \gmdate('D, d M Y H:i:s \G\M\T', $v) . '; '; + $str .= 'Expires='.\gmdate('D, d M Y H:i:s \G\M\T', $v).'; '; } else { - $str .= ($v === true ? $k : "{$k}={$v}") . '; '; + $str .= ($v === true ? $k : "{$k}={$v}").'; '; } } } @@ -379,10 +421,12 @@ public function matchesDomain(string $domain): bool // Remove the leading '.' as per spec in RFC 6265. // https://tools.ietf.org/html/rfc6265#section-5.2.3 - $cookieDomain = \ltrim($cookieDomain, '.'); + $cookieDomain = \ltrim(\strtolower($cookieDomain), '.'); + + $domain = \strtolower($domain); // Domain not set or exact match. - if (!$cookieDomain || !\strcasecmp($domain, $cookieDomain)) { + if ('' === $cookieDomain || $domain === $cookieDomain) { return true; } @@ -392,7 +436,7 @@ public function matchesDomain(string $domain): bool return false; } - return (bool) \preg_match('/\.' . \preg_quote($cookieDomain, '/') . '$/', $domain); + return (bool) \preg_match('/\.'.\preg_quote($cookieDomain, '/').'$/', $domain); } /** @@ -421,8 +465,8 @@ public function validate() $name )) { return 'Cookie name must not contain invalid characters: ASCII ' - . 'Control characters (0-31;127), space, tab and the ' - . 'following characters: ()<>@,;:\"/?={}'; + .'Control characters (0-31;127), space, tab and the ' + .'following characters: ()<>@,;:\"/?={}'; } // Value must not be null. 0 and empty string are valid. Empty strings diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php index 0c45089f1..be88d9e49 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php @@ -51,7 +51,7 @@ public function create(RequestInterface $request, array $options): EasyHandle unset($options['curl']['body_as_string']); } - $easy = new EasyHandle; + $easy = new EasyHandle(); $easy->request = $request; $easy->options = $options; $conf = $this->getDefaultConf($easy); @@ -161,11 +161,11 @@ private static function finishError(callable $handler, EasyHandle $easy, CurlFac private static function createRejection(EasyHandle $easy, array $ctx): PromiseInterface { static $connectionErrors = [ - \CURLE_OPERATION_TIMEOUTED => true, + \CURLE_OPERATION_TIMEOUTED => true, \CURLE_COULDNT_RESOLVE_HOST => true, - \CURLE_COULDNT_CONNECT => true, - \CURLE_SSL_CONNECT_ERROR => true, - \CURLE_GOT_NOTHING => true, + \CURLE_COULDNT_CONNECT => true, + \CURLE_SSL_CONNECT_ERROR => true, + \CURLE_GOT_NOTHING => true, ]; if ($easy->createResponseException) { @@ -219,12 +219,12 @@ private static function createRejection(EasyHandle $easy, array $ctx): PromiseIn private function getDefaultConf(EasyHandle $easy): array { $conf = [ - '_headers' => $easy->request->getHeaders(), - \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), - \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), + '_headers' => $easy->request->getHeaders(), + \CURLOPT_CUSTOMREQUEST => $easy->request->getMethod(), + \CURLOPT_URL => (string) $easy->request->getUri()->withFragment(''), \CURLOPT_RETURNTRANSFER => false, - \CURLOPT_HEADER => false, - \CURLOPT_CONNECTTIMEOUT => 150, + \CURLOPT_HEADER => false, + \CURLOPT_CONNECTTIMEOUT => 300, ]; if (\defined('CURLOPT_PROTOCOLS')) { @@ -250,6 +250,7 @@ private function applyMethod(EasyHandle $easy, array &$conf): void if ($size === null || $size > 0) { $this->applyBody($easy->request, $easy->options, $conf); + return; } @@ -341,6 +342,7 @@ private function removeHeader(string $name, array &$options): void foreach (\array_keys($options['_headers']) as $key) { if (!\strcasecmp($key, $name)) { unset($options['_headers'][$key]); + return; } } @@ -365,11 +367,11 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void // If it's a directory or a link to a directory use CURLOPT_CAPATH. // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. if ( - \is_dir($options['verify']) || - ( - \is_link($options['verify']) === true && - ($verifyLink = \readlink($options['verify'])) !== false && - \is_dir($verifyLink) + \is_dir($options['verify']) + || ( + \is_link($options['verify']) === true + && ($verifyLink = \readlink($options['verify'])) !== false + && \is_dir($verifyLink) ) ) { $conf[\CURLOPT_CAPATH] = $options['verify']; @@ -443,13 +445,41 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void $scheme = $easy->request->getUri()->getScheme(); if (isset($options['proxy'][$scheme])) { $host = $easy->request->getUri()->getHost(); - if (!isset($options['proxy']['no']) || !Utils::isHostInNoProxy($host, $options['proxy']['no'])) { + if (isset($options['proxy']['no']) && Utils::isHostInNoProxy($host, $options['proxy']['no'])) { + unset($conf[\CURLOPT_PROXY]); + } else { $conf[\CURLOPT_PROXY] = $options['proxy'][$scheme]; } } } } + if (isset($options['crypto_method'])) { + if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_0')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_1')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1; + } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_2')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2; + } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) { + if (!defined('CURL_SSLVERSION_TLSv1_3')) { + throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL'); + } + $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3; + } else { + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + } + if (isset($options['cert'])) { $cert = $options['cert']; if (\is_array($cert)) { @@ -459,8 +489,8 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void if (!\file_exists($cert)) { throw new \InvalidArgumentException("SSL certificate not found: {$cert}"); } - # OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. - # see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html + // OpenSSL (versions 0.9.3 and later) also support "P12" for PKCS#12-encoded files. + // see https://curl.se/libcurl/c/CURLOPT_SSLCERTTYPE.html $ext = pathinfo($cert, \PATHINFO_EXTENSION); if (preg_match('#^(der|p12)$#i', $ext)) { $conf[\CURLOPT_SSLCERTTYPE] = strtoupper($ext); @@ -523,9 +553,10 @@ private static function retryFailedRewind(callable $handler, EasyHandle $easy, a } } catch (\RuntimeException $e) { $ctx['error'] = 'The connection unexpectedly failed without ' - . 'providing an error. The request would have been retried, ' - . 'but attempting to rewind the request body failed. ' - . 'Exception: ' . $e; + .'providing an error. The request would have been retried, ' + .'but attempting to rewind the request body failed. ' + .'Exception: '.$e; + return self::createRejection($easy, $ctx); } @@ -534,14 +565,15 @@ private static function retryFailedRewind(callable $handler, EasyHandle $easy, a $easy->options['_curl_retries'] = 1; } elseif ($easy->options['_curl_retries'] == 2) { $ctx['error'] = 'The cURL request was retried 3 times ' - . 'and did not succeed. The most likely reason for the failure ' - . 'is that cURL was unable to rewind the body of the request ' - . 'and subsequent retries resulted in the same error. Turn on ' - . 'the debug option to see what went wrong. See ' - . 'https://bugs.php.net/bug.php?id=47204 for more information.'; + .'and did not succeed. The most likely reason for the failure ' + .'is that cURL was unable to rewind the body of the request ' + .'and subsequent retries resulted in the same error. Turn on ' + .'the debug option to see what went wrong. See ' + .'https://bugs.php.net/bug.php?id=47204 for more information.'; + return self::createRejection($easy, $ctx); } else { - $easy->options['_curl_retries']++; + ++$easy->options['_curl_retries']; } return $handler($easy->request, $easy->options); @@ -571,6 +603,7 @@ private function createHeaderFn(EasyHandle $easy): callable $easy->createResponse(); } catch (\Exception $e) { $easy->createResponseException = $e; + return -1; } if ($onHeaders !== null) { @@ -580,6 +613,7 @@ private function createHeaderFn(EasyHandle $easy): callable // Associate the exception with the handle and trigger // a curl header write error by returning 0. $easy->onHeadersException = $e; + return -1; } } @@ -589,7 +623,16 @@ private function createHeaderFn(EasyHandle $easy): callable } else { $easy->headers[] = $value; } + return \strlen($h); }; } + + public function __destruct() + { + foreach ($this->handles as $id => $handle) { + \curl_close($handle); + unset($this->handles[$id]); + } + } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php index 9e2e4703e..a64e1821a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -15,8 +15,6 @@ * associative array of curl option constants mapping to values in the * **curl** key of the provided request options. * - * @property resource|\CurlMultiHandle $_mh Internal use only. Lazy loaded multi-handle. - * * @final */ class CurlMultiHandler @@ -32,9 +30,9 @@ class CurlMultiHandler private $selectTimeout; /** - * @var resource|\CurlMultiHandle|null the currently executing resource in `curl_multi_exec`. + * @var int Will be higher than 0 when `curl_multi_exec` is still running. */ - private $active; + private $active = 0; /** * @var array Request entry handles, indexed by handle id in `addRequest`. @@ -55,6 +53,9 @@ class CurlMultiHandler */ private $options = []; + /** @var resource|\CurlMultiHandle */ + private $_mh; + /** * This handler accepts the following options: * @@ -78,6 +79,10 @@ public function __construct(array $options = []) } $this->options = $options['options'] ?? []; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->_mh); } /** @@ -163,7 +168,8 @@ public function tick(): void \usleep(250); } - while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM); + while (\curl_multi_exec($this->_mh, $this->active) === \CURLM_CALL_MULTI_PERFORM) { + } $this->processMessages(); } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php index 224344d7c..1bc39f4b4 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php @@ -106,7 +106,7 @@ public function createResponse(): void */ public function __get($name) { - $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: ' . $name; + $msg = $name === 'handle' ? 'The EasyHandle has been released' : 'Invalid property: '.$name; throw new \BadMethodCallException($msg); } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php index a0988845f..5554b8fa9 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/HeaderProcessor.php @@ -14,9 +14,9 @@ final class HeaderProcessor * * @param string[] $headers * - * @throws \RuntimeException - * * @return array{0:string, 1:int, 2:?string, 3:array} + * + * @throws \RuntimeException */ public static function parseHeaders(array $headers): array { diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php index 79664e279..77ffed521 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php @@ -138,6 +138,7 @@ function ($reason) use ($request, $options) { if ($this->onRejected) { ($this->onRejected)($reason); } + return P\Create::rejectionFor($reason); } ); @@ -159,7 +160,7 @@ public function append(...$values): void ) { $this->queue[] = $value; } else { - throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found ' . Utils::describeType($value)); + throw new \TypeError('Expected a Response, Promise, Throwable or callable. Found '.Utils::describeType($value)); } } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php index 70c646be5..61632f564 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php @@ -67,7 +67,7 @@ public function __invoke(RequestInterface $request, array $options): PromiseInte if (false !== \strpos($message, 'getaddrinfo') // DNS lookup failed || false !== \strpos($message, 'Connection refused') || false !== \strpos($message, "couldn't connect to host") // error on HHVM - || false !== \strpos($message, "connection attempt failed") + || false !== \strpos($message, 'connection attempt failed') ) { $e = new ConnectException($e->getMessage(), $request, $e); } else { @@ -231,9 +231,10 @@ private function createResource(callable $callback) \set_error_handler(static function ($_, $msg, $file, $line) use (&$errors): bool { $errors[] = [ 'message' => $msg, - 'file' => $file, - 'line' => $line + 'file' => $file, + 'line' => $line, ]; + return true; }); @@ -247,7 +248,7 @@ private function createResource(callable $callback) $message = 'Error creating resource: '; foreach ($errors as $err) { foreach ($err as $key => $value) { - $message .= "[$key] $value" . \PHP_EOL; + $message .= "[$key] $value".\PHP_EOL; } } throw new \RuntimeException(\trim($message)); @@ -266,6 +267,10 @@ private function createStream(RequestInterface $request, array $options) $methods = \array_flip(\get_class_methods(__CLASS__)); } + if (!\in_array($request->getUri()->getScheme(), ['http', 'https'])) { + throw new RequestException(\sprintf("The scheme '%s' is not supported.", $request->getUri()->getScheme()), $request); + } + // HTTP/1.1 streams using the PHP stream wrapper require a // Connection: close header if ($request->getProtocolVersion() == '1.1' @@ -318,7 +323,7 @@ static function () use ($context, $params) { return $this->createResource( function () use ($uri, &$http_response_header, $contextResource, $context, $options, $request) { $resource = @\fopen((string) $uri, 'r', false, $contextResource); - $this->lastHeaders = $http_response_header; + $this->lastHeaders = $http_response_header ?? []; if (false === $resource) { throw new ConnectException(sprintf('Connection refused for URI %s', $uri), $request, null, $context); @@ -346,6 +351,7 @@ private function resolveHost(RequestInterface $request, array $options): UriInte if (false === $records || !isset($records[0]['ip'])) { throw new ConnectException(\sprintf("Could not resolve IPv4 address for host '%s'", $uri->getHost()), $request); } + return $uri->withHost($records[0]['ip']); } if ('v6' === $options['force_ip_resolve']) { @@ -353,7 +359,8 @@ private function resolveHost(RequestInterface $request, array $options): UriInte if (false === $records || !isset($records[0]['ipv6'])) { throw new ConnectException(\sprintf("Could not resolve IPv6 address for host '%s'", $uri->getHost()), $request); } - return $uri->withHost('[' . $records[0]['ipv6'] . ']'); + + return $uri->withHost('['.$records[0]['ipv6'].']'); } } @@ -371,17 +378,20 @@ private function getDefaultContext(RequestInterface $request): array $context = [ 'http' => [ - 'method' => $request->getMethod(), - 'header' => $headers, + 'method' => $request->getMethod(), + 'header' => $headers, 'protocol_version' => $request->getProtocolVersion(), - 'ignore_errors' => true, - 'follow_location' => 0, + 'ignore_errors' => true, + 'follow_location' => 0, + ], + 'ssl' => [ + 'peer_name' => $request->getUri()->getHost(), ], ]; $body = (string) $request->getBody(); - if (!empty($body)) { + if ('' !== $body) { $context['http']['content'] = $body; // Prevent the HTTP handler from adding a Content-Type header. if (!$request->hasHeader('Content-Type')) { @@ -465,6 +475,25 @@ private function add_timeout(RequestInterface $request, array &$options, $value, } } + /** + * @param mixed $value as passed via Request transfer options. + */ + private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void + { + if ( + $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT + || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT + || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT) + ) { + $options['http']['crypto_method'] = $value; + + return; + } + + throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided'); + } + /** * @param mixed $value as passed via Request transfer options. */ @@ -535,27 +564,27 @@ private function add_debug(RequestInterface $request, array &$options, $value, a } static $map = [ - \STREAM_NOTIFY_CONNECT => 'CONNECT', + \STREAM_NOTIFY_CONNECT => 'CONNECT', \STREAM_NOTIFY_AUTH_REQUIRED => 'AUTH_REQUIRED', - \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', - \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', - \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', - \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', - \STREAM_NOTIFY_PROGRESS => 'PROGRESS', - \STREAM_NOTIFY_FAILURE => 'FAILURE', - \STREAM_NOTIFY_COMPLETED => 'COMPLETED', - \STREAM_NOTIFY_RESOLVE => 'RESOLVE', + \STREAM_NOTIFY_AUTH_RESULT => 'AUTH_RESULT', + \STREAM_NOTIFY_MIME_TYPE_IS => 'MIME_TYPE_IS', + \STREAM_NOTIFY_FILE_SIZE_IS => 'FILE_SIZE_IS', + \STREAM_NOTIFY_REDIRECTED => 'REDIRECTED', + \STREAM_NOTIFY_PROGRESS => 'PROGRESS', + \STREAM_NOTIFY_FAILURE => 'FAILURE', + \STREAM_NOTIFY_COMPLETED => 'COMPLETED', + \STREAM_NOTIFY_RESOLVE => 'RESOLVE', ]; static $args = ['severity', 'message', 'message_code', 'bytes_transferred', 'bytes_max']; $value = Utils::debugResource($value); - $ident = $request->getMethod() . ' ' . $request->getUri()->withFragment(''); + $ident = $request->getMethod().' '.$request->getUri()->withFragment(''); self::addNotification( $params, static function (int $code, ...$passed) use ($ident, $value, $map, $args): void { \fprintf($value, '<%s> [%s] ', $ident, $map[$code]); foreach (\array_filter($passed) as $i => $v) { - \fwrite($value, $args[$i] . ': "' . $v . '" '); + \fwrite($value, $args[$i].': "'.$v.'" '); } \fwrite($value, "\n"); } @@ -570,7 +599,7 @@ private static function addNotification(array &$params, callable $notify): void } else { $params['notification'] = self::callArray([ $params['notification'], - $notify + $notify, ]); } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php index e0a1d1191..6cb12f07a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -44,7 +44,7 @@ class HandlerStack * handler is provided, the best handler for your * system will be utilized. */ - public static function create(?callable $handler = null): self + public static function create(callable $handler = null): self { $stack = new self($handler ?: Utils::chooseHandler()); $stack->push(Middleware::httpErrors(), 'http_errors'); @@ -86,14 +86,14 @@ public function __toString() $stack = []; if ($this->handler !== null) { - $stack[] = "0) Handler: " . $this->debugCallable($this->handler); + $stack[] = '0) Handler: '.$this->debugCallable($this->handler); } $result = ''; foreach (\array_reverse($this->stack) as $tuple) { - $depth++; + ++$depth; $str = "{$depth}) Name: '{$tuple[1]}', "; - $str .= "Function: " . $this->debugCallable($tuple[0]); + $str .= 'Function: '.$this->debugCallable($tuple[0]); $result = "> {$str}\n{$result}"; $stack[] = $str; } @@ -122,7 +122,7 @@ public function setHandler(callable $handler): void */ public function hasHandler(): bool { - return $this->handler !== null ; + return $this->handler !== null; } /** @@ -131,7 +131,7 @@ public function hasHandler(): bool * @param callable(callable): callable $middleware Middleware function * @param string $name Name to register for this middleware. */ - public function unshift(callable $middleware, ?string $name = null): void + public function unshift(callable $middleware, string $name = null): void { \array_unshift($this->stack, [$middleware, $name]); $this->cached = null; @@ -266,10 +266,10 @@ private function debugCallable($fn): string if (\is_array($fn)) { return \is_string($fn[0]) ? "callable({$fn[0]}::{$fn[1]})" - : "callable(['" . \get_class($fn[0]) . "', '{$fn[1]}'])"; + : "callable(['".\get_class($fn[0])."', '{$fn[1]}'])"; } /** @var object $fn */ - return 'callable(' . \spl_object_hash($fn) . ')'; + return 'callable('.\spl_object_hash($fn).')'; } } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php index da499547f..04e9eb37a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -40,11 +40,11 @@ class MessageFormatter implements MessageFormatterInterface /** * Apache Common Log Format. * - * @link https://httpd.apache.org/docs/2.4/logs.html#common + * @see https://httpd.apache.org/docs/2.4/logs.html#common * * @var string */ - public const CLF = "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}"; + public const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}'; public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; @@ -68,7 +68,7 @@ public function __construct(?string $template = self::CLF) * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string + public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string { $cache = []; @@ -90,9 +90,9 @@ function (array $matches) use ($request, $response, $error, &$cache) { break; case 'req_headers': $result = \trim($request->getMethod() - . ' ' . $request->getRequestTarget()) - . ' HTTP/' . $request->getProtocolVersion() . "\r\n" - . $this->headers($request); + .' '.$request->getRequestTarget()) + .' HTTP/'.$request->getProtocolVersion()."\r\n" + .$this->headers($request); break; case 'res_headers': $result = $response ? @@ -101,7 +101,7 @@ function (array $matches) use ($request, $response, $error, &$cache) { $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase() - ) . "\r\n" . $this->headers($response) + )."\r\n".$this->headers($response) : 'NULL'; break; case 'req_body': @@ -177,6 +177,7 @@ function (array $matches) use ($request, $response, $error, &$cache) { } $cache[$matches[1]] = $result; + return $result; }, $this->template @@ -190,7 +191,7 @@ private function headers(MessageInterface $message): string { $result = ''; foreach ($message->getHeaders() as $name => $values) { - $result .= $name . ': ' . \implode(', ', $values) . "\r\n"; + $result .= $name.': '.\implode(', ', $values)."\r\n"; } return \trim($result); diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php index a39ac248e..47934614a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -14,5 +14,5 @@ interface MessageFormatterInterface * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string; + public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string; } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Middleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Middleware.php index 7035c77ff..7e3eb6b3a 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Middleware.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Middleware.php @@ -34,10 +34,12 @@ public static function cookies(): callable } $cookieJar = $options['cookies']; $request = $cookieJar->withCookieHeader($request); + return $handler($request, $options) ->then( static function (ResponseInterface $response) use ($cookieJar, $request): ResponseInterface { $cookieJar->extractCookies($request, $response); + return $response; } ); @@ -60,6 +62,7 @@ public static function httpErrors(BodySummarizerInterface $bodySummarizer = null if (empty($options['http_errors'])) { return $handler($request, $options); } + return $handler($request, $options)->then( static function (ResponseInterface $response) use ($request, $bodySummarizer) { $code = $response->getStatusCode(); @@ -93,20 +96,22 @@ public static function history(&$container): callable return $handler($request, $options)->then( static function ($value) use ($request, &$container, $options) { $container[] = [ - 'request' => $request, + 'request' => $request, 'response' => $value, - 'error' => null, - 'options' => $options + 'error' => null, + 'options' => $options, ]; + return $value; }, static function ($reason) use ($request, &$container, $options) { $container[] = [ - 'request' => $request, + 'request' => $request, 'response' => null, - 'error' => $reason, - 'options' => $options + 'error' => $reason, + 'options' => $options, ]; + return P\Create::rejectionFor($reason); } ); @@ -138,6 +143,7 @@ public static function tap(callable $before = null, callable $after = null): cal if ($after) { $after($request, $options, $response); } + return $response; }; }; @@ -202,12 +208,14 @@ public static function log(LoggerInterface $logger, $formatter, string $logLevel static function ($response) use ($logger, $request, $formatter, $logLevel): ResponseInterface { $message = $formatter->format($request, $response); $logger->log($logLevel, $message); + return $response; }, static function ($reason) use ($logger, $request, $formatter): PromiseInterface { $response = $reason instanceof RequestException ? $reason->getResponse() : null; $message = $formatter->format($request, $response, P\Create::exceptionFor($reason)); $logger->error($message); + return P\Create::rejectionFor($reason); } ); diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php index 7ca628338..0a8de8128 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php @@ -84,6 +84,7 @@ private function addExpectHeader(RequestInterface $request, array $options, arra // The expect header is unconditionally enabled if ($expect === true) { $modify['set_headers']['Expect'] = '100-Continue'; + return; } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index 1dd38614f..7aa21a623 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -27,10 +27,10 @@ class RedirectMiddleware * @var array */ public static $defaultSettings = [ - 'max' => 5, - 'protocols' => ['http', 'https'], - 'strict' => false, - 'referer' => false, + 'max' => 5, + 'protocols' => ['http', 'https'], + 'strict' => false, + 'referer' => false, 'track_redirects' => false, ]; @@ -88,6 +88,14 @@ public function checkRedirect(RequestInterface $request, array $options, Respons $this->guardMax($request, $response, $options); $nextRequest = $this->modifyRequest($request, $options, $response); + // If authorization is handled by curl, unset it if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $nextRequest->getUri()) && defined('\CURLOPT_HTTPAUTH')) { + unset( + $options['curl'][\CURLOPT_HTTPAUTH], + $options['curl'][\CURLOPT_USERPWD] + ); + } + if (isset($options['allow_redirects']['on_redirect'])) { ($options['allow_redirects']['on_redirect'])( $request, @@ -132,7 +140,7 @@ static function (ResponseInterface $response) use ($uri, $statusCode) { } /** - * Check for too many redirects + * Check for too many redirects. * * @throws TooManyRedirectsException Too many redirects. */ @@ -158,8 +166,8 @@ public function modifyRequest(RequestInterface $request, array $options, Respons // not forcing RFC compliance, but rather emulating what all browsers // would do. $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && !$options['allow_redirects']['strict']) + if ($statusCode == 303 + || ($statusCode <= 302 && !$options['allow_redirects']['strict']) ) { $safeMethods = ['GET', 'HEAD', 'OPTIONS']; $requestMethod = $request->getMethod(); @@ -168,7 +176,7 @@ public function modifyRequest(RequestInterface $request, array $options, Respons $modify['body'] = ''; } - $uri = $this->redirectUri($request, $response, $protocols); + $uri = self::redirectUri($request, $response, $protocols); if (isset($options['idn_conversion']) && ($options['idn_conversion'] !== false)) { $idnOptions = ($options['idn_conversion'] === true) ? \IDNA_DEFAULT : $options['idn_conversion']; $uri = Utils::idnUriConvert($uri, $idnOptions); @@ -188,19 +196,23 @@ public function modifyRequest(RequestInterface $request, array $options, Respons $modify['remove_headers'][] = 'Referer'; } - // Remove Authorization header if host is different. - if ($request->getUri()->getHost() !== $modify['uri']->getHost()) { + // Remove Authorization and Cookie headers if URI is cross-origin. + if (Psr7\UriComparator::isCrossOrigin($request->getUri(), $modify['uri'])) { $modify['remove_headers'][] = 'Authorization'; + $modify['remove_headers'][] = 'Cookie'; } return Psr7\Utils::modifyRequest($request, $modify); } /** - * Set the appropriate URL on the request based on the location header + * Set the appropriate URL on the request based on the location header. */ - private function redirectUri(RequestInterface $request, ResponseInterface $response, array $protocols): UriInterface - { + private static function redirectUri( + RequestInterface $request, + ResponseInterface $response, + array $protocols + ): UriInterface { $location = Psr7\UriResolver::resolve( $request->getUri(), new Psr7\Uri($response->getHeaderLine('Location')) diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php b/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php index 20b31bc20..bf3b02b6b 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/RequestOptions.php @@ -7,7 +7,7 @@ * * More documentation for each option can be found at http://guzzlephp.org/. * - * @link http://docs.guzzlephp.org/en/v6/request-options.html + * @see http://docs.guzzlephp.org/en/v6/request-options.html */ final class RequestOptions { @@ -70,10 +70,22 @@ final class RequestOptions /** * connect_timeout: (float, default=0) Float describing the number of * seconds to wait while trying to connect to a server. Use 0 to wait - * indefinitely (the default behavior). + * 300 seconds (the default behavior). */ public const CONNECT_TIMEOUT = 'connect_timeout'; + /** + * crypto_method: (int) A value describing the minimum TLS protocol + * version to use. + * + * This setting must be set to one of the + * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is + * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required + * in order to specify a crypto method, with cURL 7.52.0 or higher being + * required to use TLS 1.3. + */ + public const CRYPTO_METHOD = 'crypto_method'; + /** * debug: (bool|resource) Set to true or set to a PHP stream returned by * fopen() enable debug output with the HTTP handler used to send a diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php b/tests/integration/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php index c210fc47b..8f4d93ac4 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php @@ -44,7 +44,7 @@ public function __construct(callable $decider, callable $nextHandler, callable $ { $this->decider = $decider; $this->nextHandler = $nextHandler; - $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; + $this->delay = $delay ?: __CLASS__.'::exponentialDelay'; } /** @@ -54,7 +54,7 @@ public function __construct(callable $decider, callable $nextHandler, callable $ */ public static function exponentialDelay(int $retries): int { - return (int) \pow(2, $retries - 1) * 1000; + return (int) 2 ** ($retries - 1) * 1000; } public function __invoke(RequestInterface $request, array $options): PromiseInterface @@ -64,6 +64,7 @@ public function __invoke(RequestInterface $request, array $options): PromiseInte } $fn = $this->nextHandler; + return $fn($request, $options) ->then( $this->onFulfilled($request, $options), @@ -85,6 +86,7 @@ private function onFulfilled(RequestInterface $request, array $options): callabl )) { return $value; } + return $this->doRetry($request, $options, $value); }; } @@ -103,13 +105,14 @@ private function onRejected(RequestInterface $req, array $options): callable )) { return P\Create::rejectionFor($reason); } + return $this->doRetry($req, $options); }; } private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null): PromiseInterface { - $options['delay'] = ($this->delay)(++$options['retries'], $response); + $options['delay'] = ($this->delay)(++$options['retries'], $response, $request); return $this($request, $options); } diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php b/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php index 93fa334c8..2ce9e38f2 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -46,8 +46,8 @@ final class TransferStats */ public function __construct( RequestInterface $request, - ?ResponseInterface $response = null, - ?float $transferTime = null, + ResponseInterface $response = null, + float $transferTime = null, $handlerErrorData = null, array $handlerStats = [] ) { diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php b/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php index 91591da2e..fcf571d6b 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/Utils.php @@ -23,9 +23,9 @@ public static function describeType($input): string { switch (\gettype($input)) { case 'object': - return 'object(' . \get_class($input) . ')'; + return 'object('.\get_class($input).')'; case 'array': - return 'array(' . \count($input) . ')'; + return 'array('.\count($input).')'; default: \ob_start(); \var_dump($input); @@ -79,19 +79,22 @@ public static function debugResource($value = null) * * The returned handler is not wrapped by any default middlewares. * - * @throws \RuntimeException if no viable Handler is available. - * * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. + * + * @throws \RuntimeException if no viable Handler is available. */ public static function chooseHandler(): callable { $handler = null; - if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { - $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); - } elseif (\function_exists('curl_exec')) { - $handler = new CurlHandler(); - } elseif (\function_exists('curl_multi_exec')) { - $handler = new CurlMultiHandler(); + + if (\defined('CURLOPT_CUSTOMREQUEST')) { + if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { + $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); + } elseif (\function_exists('curl_exec')) { + $handler = new CurlHandler(); + } elseif (\function_exists('curl_multi_exec')) { + $handler = new CurlMultiHandler(); + } } if (\ini_get('allow_url_fopen')) { @@ -244,8 +247,8 @@ public static function isHostInNoProxy(string $host, array $noProxyArray): bool } // Special match if the area when prefixed with ".". Remove any // existing leading "." and add a new leading ".". - $area = '.' . \ltrim($area, '.'); - if (\substr($host, -(\strlen($area))) === $area) { + $area = '.'.\ltrim($area, '.'); + if (\substr($host, -\strlen($area)) === $area) { return true; } } @@ -266,13 +269,13 @@ public static function isHostInNoProxy(string $host, array $noProxyArray): bool * * @throws InvalidArgumentException if the JSON cannot be decoded. * - * @link https://www.php.net/manual/en/function.json-decode.php + * @see https://www.php.net/manual/en/function.json-decode.php */ public static function jsonDecode(string $json, bool $assoc = false, int $depth = 512, int $options = 0) { $data = \json_decode($json, $assoc, $depth, $options); if (\JSON_ERROR_NONE !== \json_last_error()) { - throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg()); + throw new InvalidArgumentException('json_decode error: '.\json_last_error_msg()); } return $data; @@ -287,13 +290,13 @@ public static function jsonDecode(string $json, bool $assoc = false, int $depth * * @throws InvalidArgumentException if the JSON cannot be encoded. * - * @link https://www.php.net/manual/en/function.json-encode.php + * @see https://www.php.net/manual/en/function.json-encode.php */ public static function jsonEncode($value, int $options = 0, int $depth = 512): string { $json = \json_encode($value, $options, $depth); if (\JSON_ERROR_NONE !== \json_last_error()) { - throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg()); + throw new InvalidArgumentException('json_encode error: '.\json_last_error_msg()); } /** @var string */ @@ -338,7 +341,7 @@ public static function idnUriConvert(UriInterface $uri, int $options = 0): UriIn $errorMessage = 'IDN conversion failed'; if ($errors) { - $errorMessage .= ' (errors: ' . implode(', ', $errors) . ')'; + $errorMessage .= ' (errors: '.implode(', ', $errors).')'; } throw new InvalidArgumentException($errorMessage); diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php b/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php index a70d2cbf3..5edc66ab1 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/functions.php @@ -50,10 +50,10 @@ function debug_resource($value = null) * * The returned handler is not wrapped by any default middlewares. * - * @throws \RuntimeException if no viable Handler is available. - * * @return callable(\Psr\Http\Message\RequestInterface, array): \GuzzleHttp\Promise\PromiseInterface Returns the best handler for the given system. * + * @throws \RuntimeException if no viable Handler is available. + * * @deprecated choose_handler will be removed in guzzlehttp/guzzle:8.0. Use Utils::chooseHandler instead. */ function choose_handler(): callable @@ -141,7 +141,7 @@ function is_host_in_noproxy(string $host, array $noProxyArray): bool * * @throws Exception\InvalidArgumentException if the JSON cannot be decoded. * - * @link https://www.php.net/manual/en/function.json-decode.php + * @see https://www.php.net/manual/en/function.json-decode.php * @deprecated json_decode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonDecode instead. */ function json_decode(string $json, bool $assoc = false, int $depth = 512, int $options = 0) @@ -158,7 +158,7 @@ function json_decode(string $json, bool $assoc = false, int $depth = 512, int $o * * @throws Exception\InvalidArgumentException if the JSON cannot be encoded. * - * @link https://www.php.net/manual/en/function.json-encode.php + * @see https://www.php.net/manual/en/function.json-encode.php * @deprecated json_encode will be removed in guzzlehttp/guzzle:8.0. Use Utils::jsonEncode instead. */ function json_encode($value, int $options = 0, int $depth = 512): string diff --git a/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php b/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php index 6636a4224..394f95347 100644 --- a/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php +++ b/tests/integration/vendor/guzzlehttp/guzzle/src/functions_include.php @@ -2,5 +2,5 @@ // Don't redefine the functions if included multiple times. if (!\function_exists('GuzzleHttp\describe_type')) { - require __DIR__ . '/functions.php'; + require __DIR__.'/functions.php'; } diff --git a/tests/integration/vendor/guzzlehttp/promises/CHANGELOG.md b/tests/integration/vendor/guzzlehttp/promises/CHANGELOG.md index 235e13bc7..eaf2af426 100644 --- a/tests/integration/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/tests/integration/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,5 +1,43 @@ # CHANGELOG + +## 2.0.1 - 2023-08-03 + +### Changed + +- PHP 8.3 support + + +## 2.0.0 - 2023-05-21 + +### Added + +- Added PHP 7 type hints + +### Changed + +- All previously non-final non-exception classes have been marked as soft-final + +### Removed + +- Dropped PHP < 7.2 support +- All functions in the `GuzzleHttp\Promise` namespace + + +## 1.5.3 - 2023-05-21 + +### Changed + +- Removed remaining usage of deprecated functions + + +## 1.5.2 - 2022-08-07 + +### Changed + +- Officially support PHP 8.2 + + ## 1.5.1 - 2021-10-22 ### Fixed @@ -7,15 +45,18 @@ - Revert "Call handler when waiting on fulfilled/rejected Promise" - Fix pool memory leak when empty array of promises provided + ## 1.5.0 - 2021-10-07 ### Changed - Call handler when waiting on fulfilled/rejected Promise +- Officially support PHP 8.1 ### Fixed -- Fix manually settle promises generated with Utils::task +- Fix manually settle promises generated with `Utils::task` + ## 1.4.1 - 2021-02-18 @@ -23,6 +64,7 @@ - Fixed `each_limit` skipping promises and failing + ## 1.4.0 - 2020-09-30 ### Added diff --git a/tests/integration/vendor/guzzlehttp/promises/Makefile b/tests/integration/vendor/guzzlehttp/promises/Makefile deleted file mode 100644 index 8d5b3ef95..000000000 --- a/tests/integration/vendor/guzzlehttp/promises/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/tests/integration/vendor/guzzlehttp/promises/README.md b/tests/integration/vendor/guzzlehttp/promises/README.md index c175fec76..a32d3d29c 100644 --- a/tests/integration/vendor/guzzlehttp/promises/README.md +++ b/tests/integration/vendor/guzzlehttp/promises/README.md @@ -17,7 +17,7 @@ for a general introduction to promises. - [Implementation notes](#implementation-notes) -# Features +## Features - [Promises/A+](https://promisesaplus.com/) implementation. - Promise resolution and chaining is handled iteratively, allowing for @@ -29,15 +29,29 @@ for a general introduction to promises. `GuzzleHttp\Promise\Coroutine::of()`. -# Quick start +## Installation + +```shell +composer require guzzlehttp/promises +``` + + +## Version Guidance + +| Version | Status | PHP Version | +|---------|------------------------|--------------| +| 1.x | Bug and security fixes | >=5.5,<8.3 | +| 2.x | Latest | >=7.2.5,<8.4 | + + +## Quick Start A *promise* represents the eventual result of an asynchronous operation. The primary way of interacting with a promise is through its `then` method, which registers callbacks to receive either a promise's eventual value or the reason why the promise cannot be fulfilled. - -## Callbacks +### Callbacks Callbacks are registered with the `then` method by providing an optional `$onFulfilled` followed by an optional `$onRejected` function. @@ -60,12 +74,11 @@ $promise->then( ``` *Resolving* a promise means that you either fulfill a promise with a *value* or -reject a promise with a *reason*. Resolving a promises triggers callbacks -registered with the promises's `then` method. These callbacks are triggered +reject a promise with a *reason*. Resolving a promise triggers callbacks +registered with the promise's `then` method. These callbacks are triggered only once and in the order in which they were added. - -## Resolving a promise +### Resolving a Promise Promises are fulfilled using the `resolve($value)` method. Resolving a promise with any value other than a `GuzzleHttp\Promise\RejectedPromise` will trigger @@ -92,8 +105,7 @@ $promise $promise->resolve('reader.'); ``` - -## Promise forwarding +### Promise Forwarding Promises can be chained one after the other. Each then in the chain is a new promise. The return value of a promise is what's forwarded to the next @@ -123,7 +135,7 @@ $promise->resolve('A'); $nextPromise->resolve('B'); ``` -## Promise rejection +### Promise Rejection When a promise is rejected, the `$onRejected` callbacks are invoked with the rejection reason. @@ -140,7 +152,7 @@ $promise->reject('Error!'); // Outputs "Error!" ``` -## Rejection forwarding +### Rejection Forwarding If an exception is thrown in an `$onRejected` callback, subsequent `$onRejected` callbacks are invoked with the thrown exception as the reason. @@ -195,7 +207,8 @@ $promise $promise->reject('Error!'); ``` -# Synchronous wait + +## Synchronous Wait You can synchronously force promises to complete using a promise's `wait` method. When creating a promise, you can provide a wait function that is used @@ -247,8 +260,7 @@ $promise->wait(); > PHP Fatal error: Uncaught exception 'GuzzleHttp\Promise\RejectionException' with message 'The promise was rejected with value: foo' - -## Unwrapping a promise +### Unwrapping a Promise When synchronously waiting on a promise, you are joining the state of the promise into the current state of execution (i.e., return the value of the @@ -275,7 +287,7 @@ wait function will be the value delivered to promise B. **Note**: when you do not unwrap the promise, no value is returned. -# Cancellation +## Cancellation You can cancel a promise that has not yet been fulfilled using the `cancel()` method of a promise. When creating a promise you can provide an optional @@ -283,10 +295,9 @@ cancel function that when invoked cancels the action of computing a resolution of the promise. -# API +## API - -## Promise +### Promise When creating a promise object, you can provide an optional `$waitFn` and `$cancelFn`. `$waitFn` is a function that is invoked with no arguments and is @@ -349,7 +360,7 @@ A promise has the following methods: Rejects the promise with the given `$reason`. -## FulfilledPromise +### FulfilledPromise A fulfilled promise can be created to represent a promise that has been fulfilled. @@ -366,7 +377,7 @@ $promise->then(function ($value) { ``` -## RejectedPromise +### RejectedPromise A rejected promise can be created to represent a promise that has been rejected. @@ -383,7 +394,7 @@ $promise->then(null, function ($reason) { ``` -# Promise interop +## Promise Interoperability This library works with foreign promises that have a `then` method. This means you can use Guzzle promises with [React promises](https://github.com/reactphp/promise) @@ -409,7 +420,7 @@ a foreign promise. You will need to wrap a third-party promise with a Guzzle promise in order to utilize wait and cancel functions with foreign promises. -## Event Loop Integration +### Event Loop Integration In order to keep the stack size constant, Guzzle promises are resolved asynchronously using a task queue. When waiting on promises synchronously, the @@ -434,13 +445,10 @@ $loop = React\EventLoop\Factory::create(); $loop->addPeriodicTimer(0, [$queue, 'run']); ``` -*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? - -# Implementation notes +## Implementation Notes - -## Promise resolution and chaining is handled iteratively +### Promise Resolution and Chaining is Handled Iteratively By shuffling pending handlers from one owner to another, promises are resolved iteratively, allowing for "infinite" then chaining. @@ -476,8 +484,7 @@ all of its pending handlers to the new promise. When the new promise is eventually resolved, all of the pending handlers are delivered the forwarded value. - -## A promise is the deferred. +### A Promise is the Deferred Some promise libraries implement promises using a deferred object to represent a computation and a promise object to represent the delivery of the result of @@ -505,7 +512,10 @@ $promise->resolve('foo'); ## Upgrading from Function API -A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The function API will be removed in 2.0.0. A migration table has been provided here for your convenience: +A static API was first introduced in 1.4.0, in order to mitigate problems with +functions conflicting between global and local copies of the package. The +function API was removed in 2.0.0. A migration table has been provided here for +your convenience: | Original Function | Replacement Method | |----------------|----------------| @@ -536,10 +546,12 @@ A static API was first introduced in 1.4.0, in order to mitigate problems with f 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/promises/security/policy) for more information. + ## License Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + ## For Enterprise Available as part of the Tidelift Subscription diff --git a/tests/integration/vendor/guzzlehttp/promises/composer.json b/tests/integration/vendor/guzzlehttp/promises/composer.json index c959fb32b..fc1989ec1 100644 --- a/tests/integration/vendor/guzzlehttp/promises/composer.json +++ b/tests/integration/vendor/guzzlehttp/promises/composer.json @@ -26,32 +26,32 @@ } ], "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" - }, - "files": ["src/functions_include.php"] + } }, "autoload-dev": { "psr-4": { "GuzzleHttp\\Promise\\Tests\\": "tests/" } }, - "scripts": { - "test": "vendor/bin/simple-phpunit", - "test-ci": "vendor/bin/simple-phpunit --coverage-text" - }, "extra": { - "branch-alias": { - "dev-master": "1.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, "preferred-install": "dist", "sort-packages": true } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php b/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php index d2b5712b9..40ffdbcf1 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/AggregateException.php @@ -1,5 +1,7 @@ generator = $generatorFn(); - $this->result = new Promise(function () { + $this->result = new Promise(function (): void { while (isset($this->currentPromise)) { $this->currentPromise->wait(); } }); try { $this->nextCoroutine($this->generator->current()); - } catch (\Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } @@ -78,10 +77,8 @@ public function __construct(callable $generatorFn) /** * Create a new coroutine. - * - * @return self */ - public static function of(callable $generatorFn) + public static function of(callable $generatorFn): self { return new self($generatorFn); } @@ -89,42 +86,42 @@ public static function of(callable $generatorFn) public function then( callable $onFulfilled = null, callable $onRejected = null - ) { + ): PromiseInterface { return $this->result->then($onFulfilled, $onRejected); } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->result->otherwise($onRejected); } - public function wait($unwrap = true) + public function wait(bool $unwrap = true) { return $this->result->wait($unwrap); } - public function getState() + public function getState(): string { return $this->result->getState(); } - public function resolve($value) + public function resolve($value): void { $this->result->resolve($value); } - public function reject($reason) + public function reject($reason): void { $this->result->reject($reason); } - public function cancel() + public function cancel(): void { $this->currentPromise->cancel(); $this->result->cancel(); } - private function nextCoroutine($yielded) + private function nextCoroutine($yielded): void { $this->currentPromise = Create::promiseFor($yielded) ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); @@ -133,7 +130,7 @@ private function nextCoroutine($yielded) /** * @internal */ - public function _handleSuccess($value) + public function _handleSuccess($value): void { unset($this->currentPromise); try { @@ -143,8 +140,6 @@ public function _handleSuccess($value) } else { $this->result->resolve($value); } - } catch (Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } @@ -153,15 +148,13 @@ public function _handleSuccess($value) /** * @internal */ - public function _handleFailure($reason) + public function _handleFailure($reason): void { unset($this->currentPromise); try { $nextYield = $this->generator->throw(Create::exceptionFor($reason)); // The throw was caught, so keep iterating on the coroutine $this->nextCoroutine($nextYield); - } catch (Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Create.php b/tests/integration/vendor/guzzlehttp/promises/src/Create.php index 8d038e9c1..9d3fc4a1e 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/Create.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/Create.php @@ -1,5 +1,7 @@ then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; } @@ -34,10 +35,8 @@ public static function promiseFor($value) * If the provided reason is a promise, then it is returned as-is. * * @param mixed $reason Promise or reason. - * - * @return PromiseInterface */ - public static function rejectionFor($reason) + public static function rejectionFor($reason): PromiseInterface { if ($reason instanceof PromiseInterface) { return $reason; @@ -50,12 +49,10 @@ public static function rejectionFor($reason) * Create an exception for a rejected promise value. * * @param mixed $reason - * - * @return \Exception|\Throwable */ - public static function exceptionFor($reason) + public static function exceptionFor($reason): \Throwable { - if ($reason instanceof \Exception || $reason instanceof \Throwable) { + if ($reason instanceof \Throwable) { return $reason; } @@ -66,10 +63,8 @@ public static function exceptionFor($reason) * Returns an iterator for the given value. * * @param mixed $value - * - * @return \Iterator */ - public static function iterFor($value) + public static function iterFor($value): \Iterator { if ($value instanceof \Iterator) { return $value; diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Each.php b/tests/integration/vendor/guzzlehttp/promises/src/Each.php index 1dda35499..1a7aa0fb6 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/Each.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/Each.php @@ -1,5 +1,7 @@ $onFulfilled, - 'rejected' => $onRejected + 'rejected' => $onRejected, ]))->promise(); } @@ -46,19 +46,17 @@ public static function of( * @param int|callable $concurrency * @param callable $onFulfilled * @param callable $onRejected - * - * @return PromiseInterface */ public static function ofLimit( $iterable, $concurrency, callable $onFulfilled = null, callable $onRejected = null - ) { + ): PromiseInterface { return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected, - 'concurrency' => $concurrency + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency, ]))->promise(); } @@ -70,19 +68,17 @@ public static function ofLimit( * @param mixed $iterable * @param int|callable $concurrency * @param callable $onFulfilled - * - * @return PromiseInterface */ public static function ofLimitAll( $iterable, $concurrency, callable $onFulfilled = null - ) { - return each_limit( + ): PromiseInterface { + return self::ofLimit( $iterable, $concurrency, $onFulfilled, - function ($reason, $idx, PromiseInterface $aggregate) { + function ($reason, $idx, PromiseInterface $aggregate): void { $aggregate->reject($reason); } ); diff --git a/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php b/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php index 38ecb59b1..28dd9793a 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/EachPromise.php @@ -1,10 +1,14 @@ aggregate) { return $this->aggregate; @@ -81,30 +85,19 @@ public function promise() $this->iterable->rewind(); $this->refillPending(); } catch (\Throwable $e) { - /** - * @psalm-suppress NullReference - * @phpstan-ignore-next-line - */ - $this->aggregate->reject($e); - } catch (\Exception $e) { - /** - * @psalm-suppress NullReference - * @phpstan-ignore-next-line - */ $this->aggregate->reject($e); } /** * @psalm-suppress NullableReturnStatement - * @phpstan-ignore-next-line */ return $this->aggregate; } - private function createPromise() + private function createPromise(): void { $this->mutex = false; - $this->aggregate = new Promise(function () { + $this->aggregate = new Promise(function (): void { if ($this->checkIfFinished()) { return; } @@ -121,7 +114,7 @@ private function createPromise() }); // Clear the references when the promise is resolved. - $clearFn = function () { + $clearFn = function (): void { $this->iterable = $this->concurrency = $this->pending = null; $this->onFulfilled = $this->onRejected = null; $this->nextPendingIndex = 0; @@ -130,11 +123,13 @@ private function createPromise() $this->aggregate->then($clearFn, $clearFn); } - private function refillPending() + private function refillPending(): void { if (!$this->concurrency) { // Add all pending promises. - while ($this->addPending() && $this->advanceIterator()); + while ($this->addPending() && $this->advanceIterator()) { + } + return; } @@ -155,10 +150,11 @@ private function refillPending() // next value to yield until promise callbacks are called. while (--$concurrency && $this->advanceIterator() - && $this->addPending()); + && $this->addPending()) { + } } - private function addPending() + private function addPending(): bool { if (!$this->iterable || !$this->iterable->valid()) { return false; @@ -172,7 +168,7 @@ private function addPending() $idx = $this->nextPendingIndex++; $this->pending[$idx] = $promise->then( - function ($value) use ($idx, $key) { + function ($value) use ($idx, $key): void { if ($this->onFulfilled) { call_user_func( $this->onFulfilled, @@ -183,7 +179,7 @@ function ($value) use ($idx, $key) { } $this->step($idx); }, - function ($reason) use ($idx, $key) { + function ($reason) use ($idx, $key): void { if ($this->onRejected) { call_user_func( $this->onRejected, @@ -199,7 +195,7 @@ function ($reason) use ($idx, $key) { return true; } - private function advanceIterator() + private function advanceIterator(): bool { // Place a lock on the iterator so that we ensure to not recurse, // preventing fatal generator errors. @@ -212,19 +208,17 @@ private function advanceIterator() try { $this->iterable->next(); $this->mutex = false; + return true; } catch (\Throwable $e) { $this->aggregate->reject($e); $this->mutex = false; - return false; - } catch (\Exception $e) { - $this->aggregate->reject($e); - $this->mutex = false; + return false; } } - private function step($idx) + private function step(int $idx): void { // If the promise was already resolved, then ignore this step. if (Is::settled($this->aggregate)) { @@ -242,11 +236,12 @@ private function step($idx) } } - private function checkIfFinished() + private function checkIfFinished(): bool { if (!$this->pending && !$this->iterable->valid()) { // Resolve the promise if there's nothing left to do. $this->aggregate->resolve(null); + return true; } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php index 98f72a62a..ab7129659 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -1,5 +1,7 @@ value; - $queue->add(static function () use ($p, $value, $onFulfilled) { + $queue->add(static function () use ($p, $value, $onFulfilled): void { if (Is::pending($p)) { try { $p->resolve($onFulfilled($value)); } catch (\Throwable $e) { $p->reject($e); - } catch (\Exception $e) { - $p->reject($e); } } }); @@ -50,34 +55,34 @@ public function then( return $p; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true, $defaultDelivery = null) + public function wait(bool $unwrap = true) { return $unwrap ? $this->value : null; } - public function getState() + public function getState(): string { return self::FULFILLED; } - public function resolve($value) + public function resolve($value): void { if ($value !== $this->value) { - throw new \LogicException("Cannot resolve a fulfilled promise"); + throw new \LogicException('Cannot resolve a fulfilled promise'); } } - public function reject($reason) + public function reject($reason): void { - throw new \LogicException("Cannot reject a fulfilled promise"); + throw new \LogicException('Cannot reject a fulfilled promise'); } - public function cancel() + public function cancel(): void { // pass } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Is.php b/tests/integration/vendor/guzzlehttp/promises/src/Is.php index c3ed8d014..f3f050384 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/Is.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/Is.php @@ -1,45 +1,39 @@ getState() === PromiseInterface::PENDING; } /** * Returns true if a promise is fulfilled or rejected. - * - * @return bool */ - public static function settled(PromiseInterface $promise) + public static function settled(PromiseInterface $promise): bool { return $promise->getState() !== PromiseInterface::PENDING; } /** * Returns true if a promise is fulfilled. - * - * @return bool */ - public static function fulfilled(PromiseInterface $promise) + public static function fulfilled(PromiseInterface $promise): bool { return $promise->getState() === PromiseInterface::FULFILLED; } /** * Returns true if a promise is rejected. - * - * @return bool */ - public static function rejected(PromiseInterface $promise) + public static function rejected(PromiseInterface $promise): bool { return $promise->getState() === PromiseInterface::REJECTED; } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/Promise.php b/tests/integration/vendor/guzzlehttp/promises/src/Promise.php index 75939057b..1b07bdc9a 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/Promise.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/Promise.php @@ -1,11 +1,15 @@ state === self::PENDING) { $p = new Promise(null, [$this, 'cancel']); $this->handlers[] = [$p, $onFulfilled, $onRejected]; $p->waitList = $this->waitList; $p->waitList[] = $this; + return $p; } // Return a fulfilled promise and immediately invoke any callbacks. if ($this->state === self::FULFILLED) { $promise = Create::promiseFor($this->result); + return $onFulfilled ? $promise->then($onFulfilled) : $promise; } // It's either cancelled or rejected, so return a rejected promise // and immediately invoke any callbacks. $rejection = Create::rejectionFor($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true) + public function wait(bool $unwrap = true) { $this->waitIfPending(); @@ -73,12 +80,12 @@ public function wait($unwrap = true) } } - public function getState() + public function getState(): string { return $this->state; } - public function cancel() + public function cancel(): void { if ($this->state !== self::PENDING) { return; @@ -93,8 +100,6 @@ public function cancel() $fn(); } catch (\Throwable $e) { $this->reject($e); - } catch (\Exception $e) { - $this->reject($e); } } @@ -105,17 +110,17 @@ public function cancel() } } - public function resolve($value) + public function resolve($value): void { $this->settle(self::FULFILLED, $value); } - public function reject($reason) + public function reject($reason): void { $this->settle(self::REJECTED, $reason); } - private function settle($state, $value) + private function settle(string $state, $value): void { if ($this->state !== self::PENDING) { // Ignore calls with the same resolution. @@ -148,7 +153,7 @@ private function settle($state, $value) if (!is_object($value) || !method_exists($value, 'then')) { $id = $state === self::FULFILLED ? 1 : 2; // It's a success, so resolve the handlers in the queue. - Utils::queue()->add(static function () use ($id, $value, $handlers) { + Utils::queue()->add(static function () use ($id, $value, $handlers): void { foreach ($handlers as $handler) { self::callHandler($id, $value, $handler); } @@ -159,12 +164,12 @@ private function settle($state, $value) } else { // Resolve the handlers when the forwarded promise is resolved. $value->then( - static function ($value) use ($handlers) { + static function ($value) use ($handlers): void { foreach ($handlers as $handler) { self::callHandler(1, $value, $handler); } }, - static function ($reason) use ($handlers) { + static function ($reason) use ($handlers): void { foreach ($handlers as $handler) { self::callHandler(2, $reason, $handler); } @@ -180,7 +185,7 @@ static function ($reason) use ($handlers) { * @param mixed $value Value to pass to the callback. * @param array $handler Array of handler data (promise and callbacks). */ - private static function callHandler($index, $value, array $handler) + private static function callHandler(int $index, $value, array $handler): void { /** @var PromiseInterface $promise */ $promise = $handler[0]; @@ -211,12 +216,10 @@ private static function callHandler($index, $value, array $handler) } } catch (\Throwable $reason) { $promise->reject($reason); - } catch (\Exception $reason) { - $promise->reject($reason); } } - private function waitIfPending() + private function waitIfPending(): void { if ($this->state !== self::PENDING) { return; @@ -227,9 +230,9 @@ private function waitIfPending() } else { // If there's no wait function, then reject the promise. $this->reject('Cannot wait on a promise that has ' - . 'no internal wait function. You must provide a wait ' - . 'function when constructing the promise to be able to ' - . 'wait on a promise.'); + .'no internal wait function. You must provide a wait ' + .'function when constructing the promise to be able to ' + .'wait on a promise.'); } Utils::queue()->run(); @@ -240,13 +243,13 @@ private function waitIfPending() } } - private function invokeWaitFn() + private function invokeWaitFn(): void { try { $wfn = $this->waitFn; $this->waitFn = null; $wfn(true); - } catch (\Exception $reason) { + } catch (\Throwable $reason) { if ($this->state === self::PENDING) { // The promise has not been resolved yet, so reject the promise // with the exception. @@ -259,7 +262,7 @@ private function invokeWaitFn() } } - private function invokeWaitList() + private function invokeWaitList(): void { $waitList = $this->waitList; $this->waitList = null; diff --git a/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php b/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php index e59833143..2824802bb 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -1,5 +1,7 @@ reason; $p = new Promise([$queue, 'run']); - $queue->add(static function () use ($p, $reason, $onRejected) { + $queue->add(static function () use ($p, $reason, $onRejected): void { if (Is::pending($p)) { try { // Return a resolved promise if onRejected does not throw. @@ -43,9 +50,6 @@ public function then( } catch (\Throwable $e) { // onRejected threw, so return a rejected promise. $p->reject($e); - } catch (\Exception $e) { - // onRejected threw, so return a rejected promise. - $p->reject($e); } } }); @@ -53,12 +57,12 @@ public function then( return $p; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true, $defaultDelivery = null) + public function wait(bool $unwrap = true) { if ($unwrap) { throw Create::exceptionFor($this->reason); @@ -67,24 +71,24 @@ public function wait($unwrap = true, $defaultDelivery = null) return null; } - public function getState() + public function getState(): string { return self::REJECTED; } - public function resolve($value) + public function resolve($value): void { - throw new \LogicException("Cannot resolve a rejected promise"); + throw new \LogicException('Cannot resolve a rejected promise'); } - public function reject($reason) + public function reject($reason): void { if ($reason !== $this->reason) { - throw new \LogicException("Cannot reject a rejected promise"); + throw new \LogicException('Cannot reject a rejected promise'); } } - public function cancel() + public function cancel(): void { // pass } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php b/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php index e2f137707..47dca8624 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/RejectionException.php @@ -1,5 +1,7 @@ reason = $reason; $message = 'The promise was rejected'; if ($description) { - $message .= ' with reason: ' . $description; + $message .= ' with reason: '.$description; } elseif (is_string($reason) || (is_object($reason) && method_exists($reason, '__toString')) ) { - $message .= ' with reason: ' . $this->reason; + $message .= ' with reason: '.$this->reason; } elseif ($reason instanceof \JsonSerializable) { - $message .= ' with reason: ' - . json_encode($this->reason, JSON_PRETTY_PRINT); + $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT); } parent::__construct($message); diff --git a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueue.php b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueue.php index f0fba2c59..503e0b2da 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueue.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -1,5 +1,7 @@ run(); + * + * @final */ class TaskQueue implements TaskQueueInterface { private $enableShutdown = true; private $queue = []; - public function __construct($withShutdown = true) + public function __construct(bool $withShutdown = true) { if ($withShutdown) { - register_shutdown_function(function () { + register_shutdown_function(function (): void { if ($this->enableShutdown) { // Only run the tasks if an E_ERROR didn't occur. $err = error_get_last(); @@ -31,17 +35,17 @@ public function __construct($withShutdown = true) } } - public function isEmpty() + public function isEmpty(): bool { return !$this->queue; } - public function add(callable $task) + public function add(callable $task): void { $this->queue[] = $task; } - public function run() + public function run(): void { while ($task = array_shift($this->queue)) { /** @var callable $task */ @@ -60,7 +64,7 @@ public function run() * * Note: This shutdown will occur before any destructors are triggered. */ - public function disableShutdown() + public function disableShutdown(): void { $this->enableShutdown = false; } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php index 723d4d54e..34c561a48 100644 --- a/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ b/tests/integration/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -1,24 +1,24 @@ * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface + * @param TaskQueueInterface|null $assign Optionally specify a new queue instance. */ - public static function queue(TaskQueueInterface $assign = null) + public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface { static $queue; @@ -39,22 +39,18 @@ public static function queue(TaskQueueInterface $assign = null) * returns a promise that is fulfilled or rejected with the result. * * @param callable $task Task function to run. - * - * @return PromiseInterface */ - public static function task(callable $task) + public static function task(callable $task): PromiseInterface { $queue = self::queue(); $promise = new Promise([$queue, 'run']); - $queue->add(function () use ($task, $promise) { + $queue->add(function () use ($task, $promise): void { try { if (Is::pending($promise)) { $promise->resolve($task()); } } catch (\Throwable $e) { $promise->reject($e); - } catch (\Exception $e) { - $promise->reject($e); } }); @@ -72,22 +68,18 @@ public static function task(callable $task) * key mapping to the rejection reason of the promise. * * @param PromiseInterface $promise Promise or value. - * - * @return array */ - public static function inspect(PromiseInterface $promise) + public static function inspect(PromiseInterface $promise): array { try { return [ 'state' => PromiseInterface::FULFILLED, - 'value' => $promise->wait() + 'value' => $promise->wait(), ]; } catch (RejectionException $e) { return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; } catch (\Throwable $e) { return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } catch (\Exception $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; } } @@ -100,14 +92,12 @@ public static function inspect(PromiseInterface $promise) * @see inspect for the inspection state array format. * * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array */ - public static function inspectAll($promises) + public static function inspectAll($promises): array { $results = []; foreach ($promises as $key => $promise) { - $results[$key] = inspect($promise); + $results[$key] = self::inspect($promise); } return $results; @@ -122,12 +112,9 @@ public static function inspectAll($promises) * * @param iterable $promises Iterable of PromiseInterface objects to wait on. * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 + * @throws \Throwable on error */ - public static function unwrap($promises) + public static function unwrap($promises): array { $results = []; foreach ($promises as $key => $promise) { @@ -147,22 +134,21 @@ public static function unwrap($promises) * * @param mixed $promises Promises or values. * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface */ - public static function all($promises, $recursive = false) + public static function all($promises, bool $recursive = false): PromiseInterface { $results = []; $promise = Each::of( $promises, - function ($value, $idx) use (&$results) { + function ($value, $idx) use (&$results): void { $results[$idx] = $value; }, - function ($reason, $idx, Promise $aggregate) { + function ($reason, $idx, Promise $aggregate): void { $aggregate->reject($reason); } )->then(function () use (&$results) { ksort($results); + return $results; }); @@ -173,6 +159,7 @@ function ($reason, $idx, Promise $aggregate) { return self::all($promises, $recursive); } } + return $results; }); } @@ -193,17 +180,15 @@ function ($reason, $idx, Promise $aggregate) { * * @param int $count Total number of promises. * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function some($count, $promises) + public static function some(int $count, $promises): PromiseInterface { $results = []; $rejections = []; return Each::of( $promises, - function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + function ($value, $idx, PromiseInterface $p) use (&$results, $count): void { if (Is::settled($p)) { return; } @@ -212,7 +197,7 @@ function ($value, $idx, PromiseInterface $p) use (&$results, $count) { $p->resolve(null); } }, - function ($reason) use (&$rejections) { + function ($reason) use (&$rejections): void { $rejections[] = $reason; } )->then( @@ -224,6 +209,7 @@ function () use (&$results, &$rejections, $count) { ); } ksort($results); + return array_values($results); } ); @@ -234,10 +220,8 @@ function () use (&$results, &$rejections, $count) { * fulfillment value is not an array of 1 but the value directly. * * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function any($promises) + public static function any($promises): PromiseInterface { return self::some(1, $promises)->then(function ($values) { return $values[0]; @@ -253,23 +237,22 @@ public static function any($promises) * @see inspect for the inspection state array format. * * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function settle($promises) + public static function settle($promises): PromiseInterface { $results = []; return Each::of( $promises, - function ($value, $idx) use (&$results) { + function ($value, $idx) use (&$results): void { $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; }, - function ($reason, $idx) use (&$results) { + function ($reason, $idx) use (&$results): void { $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; } )->then(function () use (&$results) { ksort($results); + return $results; }); } diff --git a/tests/integration/vendor/guzzlehttp/promises/src/functions.php b/tests/integration/vendor/guzzlehttp/promises/src/functions.php deleted file mode 100644 index c03d39d02..000000000 --- a/tests/integration/vendor/guzzlehttp/promises/src/functions.php +++ /dev/null @@ -1,363 +0,0 @@ - - * while ($eventLoop->isRunning()) { - * GuzzleHttp\Promise\queue()->run(); - * } - * - * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface - * - * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. - */ -function queue(TaskQueueInterface $assign = null) -{ - return Utils::queue($assign); -} - -/** - * Adds a function to run in the task queue when it is next `run()` and returns - * a promise that is fulfilled or rejected with the result. - * - * @param callable $task Task function to run. - * - * @return PromiseInterface - * - * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. - */ -function task(callable $task) -{ - return Utils::task($task); -} - -/** - * Creates a promise for a value if the value is not a promise. - * - * @param mixed $value Promise or value. - * - * @return PromiseInterface - * - * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. - */ -function promise_for($value) -{ - return Create::promiseFor($value); -} - -/** - * Creates a rejected promise for a reason if the reason is not a promise. If - * the provided reason is a promise, then it is returned as-is. - * - * @param mixed $reason Promise or reason. - * - * @return PromiseInterface - * - * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. - */ -function rejection_for($reason) -{ - return Create::rejectionFor($reason); -} - -/** - * Create an exception for a rejected promise value. - * - * @param mixed $reason - * - * @return \Exception|\Throwable - * - * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. - */ -function exception_for($reason) -{ - return Create::exceptionFor($reason); -} - -/** - * Returns an iterator for the given value. - * - * @param mixed $value - * - * @return \Iterator - * - * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. - */ -function iter_for($value) -{ - return Create::iterFor($value); -} - -/** - * Synchronously waits on a promise to resolve and returns an inspection state - * array. - * - * Returns a state associative array containing a "state" key mapping to a - * valid promise state. If the state of the promise is "fulfilled", the array - * will contain a "value" key mapping to the fulfilled value of the promise. If - * the promise is rejected, the array will contain a "reason" key mapping to - * the rejection reason of the promise. - * - * @param PromiseInterface $promise Promise or value. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. - */ -function inspect(PromiseInterface $promise) -{ - return Utils::inspect($promise); -} - -/** - * Waits on all of the provided promises, but does not unwrap rejected promises - * as thrown exception. - * - * Returns an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. - */ -function inspect_all($promises) -{ - return Utils::inspectAll($promises); -} - -/** - * Waits on all of the provided promises and returns the fulfilled values. - * - * Returns an array that contains the value of each promise (in the same order - * the promises were provided). An exception is thrown if any of the promises - * are rejected. - * - * @param iterable $promises Iterable of PromiseInterface objects to wait on. - * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 - * - * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. - */ -function unwrap($promises) -{ - return Utils::unwrap($promises); -} - -/** - * Given an array of promises, return a promise that is fulfilled when all the - * items in the array are fulfilled. - * - * The promise's fulfillment value is an array with fulfillment values at - * respective positions to the original array. If any promise in the array - * rejects, the returned promise is rejected with the rejection reason. - * - * @param mixed $promises Promises or values. - * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface - * - * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. - */ -function all($promises, $recursive = false) -{ - return Utils::all($promises, $recursive); -} - -/** - * Initiate a competitive race between multiple promises or values (values will - * become immediately fulfilled promises). - * - * When count amount of promises have been fulfilled, the returned promise is - * fulfilled with an array that contains the fulfillment values of the winners - * in order of resolution. - * - * This promise is rejected with a {@see AggregateException} if the number of - * fulfilled promises is less than the desired $count. - * - * @param int $count Total number of promises. - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. - */ -function some($count, $promises) -{ - return Utils::some($count, $promises); -} - -/** - * Like some(), with 1 as count. However, if the promise fulfills, the - * fulfillment value is not an array of 1 but the value directly. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. - */ -function any($promises) -{ - return Utils::any($promises); -} - -/** - * Returns a promise that is fulfilled when all of the provided promises have - * been fulfilled or rejected. - * - * The returned promise is fulfilled with an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. - */ -function settle($promises) -{ - return Utils::settle($promises); -} - -/** - * Given an iterator that yields promises or values, returns a promise that is - * fulfilled with a null value when the iterator has been consumed or the - * aggregate promise has been fulfilled or rejected. - * - * $onFulfilled is a function that accepts the fulfilled value, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * $onRejected is a function that accepts the rejection reason, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * @param mixed $iterable Iterator or array to iterate over. - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. - */ -function each( - $iterable, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::of($iterable, $onFulfilled, $onRejected); -} - -/** - * Like each, but only allows a certain number of outstanding promises at any - * given time. - * - * $concurrency may be an integer or a function that accepts the number of - * pending promises and returns a numeric concurrency limit value to allow for - * dynamic a concurrency size. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. - */ -function each_limit( - $iterable, - $concurrency, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); -} - -/** - * Like each_limit, but ensures that no promise in the given $iterable argument - * is rejected. If any promise is rejected, then the aggregate promise is - * rejected with the encountered rejection. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * - * @return PromiseInterface - * - * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. - */ -function each_limit_all( - $iterable, - $concurrency, - callable $onFulfilled = null -) { - return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); -} - -/** - * Returns true if a promise is fulfilled. - * - * @return bool - * - * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. - */ -function is_fulfilled(PromiseInterface $promise) -{ - return Is::fulfilled($promise); -} - -/** - * Returns true if a promise is rejected. - * - * @return bool - * - * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. - */ -function is_rejected(PromiseInterface $promise) -{ - return Is::rejected($promise); -} - -/** - * Returns true if a promise is fulfilled or rejected. - * - * @return bool - * - * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. - */ -function is_settled(PromiseInterface $promise) -{ - return Is::settled($promise); -} - -/** - * Create a new coroutine. - * - * @see Coroutine - * - * @return PromiseInterface - * - * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. - */ -function coroutine(callable $generatorFn) -{ - return Coroutine::of($generatorFn); -} diff --git a/tests/integration/vendor/guzzlehttp/promises/src/functions_include.php b/tests/integration/vendor/guzzlehttp/promises/src/functions_include.php deleted file mode 100644 index 34cd1710a..000000000 --- a/tests/integration/vendor/guzzlehttp/promises/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ -=5.4,<8.1 | +| 2.x | Latest | >=7.2.5,<8.4 | + + ## AppendStream `GuzzleHttp\Psr7\AppendStream` @@ -245,6 +259,8 @@ class EofCallbackStream implements StreamInterface private $callback; + private $stream; + public function __construct(StreamInterface $stream, callable $cb) { $this->stream = $stream; @@ -380,10 +396,28 @@ of the header. When a parameter does not contain a value, but just contains a key, this function will inject a key with a '' string value. -## `GuzzleHttp\Psr7\Header::normalize` +## `GuzzleHttp\Psr7\Header::splitList` + +`public static function splitList(string|string[] $header): string[]` + +Splits a HTTP header defined to contain a comma-separated list into +each individual value: + +``` +$knownEtags = Header::splitList($request->getHeader('if-none-match')); +``` + +Example headers include `accept`, `cache-control` and `if-none-match`. + + +## `GuzzleHttp\Psr7\Header::normalize` (deprecated) `public static function normalize(string|array $header): array` +`Header::normalize()` is deprecated in favor of [`Header::splitList()`](README.md#guzzlehttppsr7headersplitlist) +which performs the same operation with a cleaned up API and improved +documentation. + Converts an array of header values that may contain comma separated headers into an array of headers with no comma separated values. @@ -527,6 +561,17 @@ When fopen fails, PHP normally raises a warning. This function adds an error handler that checks for errors and throws an exception instead. +## `GuzzleHttp\Psr7\Utils::tryGetContents` + +`public static function tryGetContents(resource $stream): string` + +Safely gets the contents of a given stream. + +When stream_get_contents fails, PHP normally raises a warning. This +function adds an error handler that checks for errors and throws an +exception instead. + + ## `GuzzleHttp\Psr7\Utils::uriFor` `public static function uriFor(string|UriInterface $uri): UriInterface` @@ -658,7 +703,7 @@ manually but instead is used indirectly via `Psr\Http\Message\UriInterface::__to `public static function fromParts(array $parts): UriInterface` -Creates a URI from a hash of [`parse_url`](http://php.net/manual/en/function.parse-url.php) components. +Creates a URI from a hash of [`parse_url`](https://www.php.net/manual/en/function.parse-url.php) components. ### `GuzzleHttp\Psr7\Uri::withQueryValue` @@ -683,6 +728,16 @@ associative array of key => value. Creates a new URI with a specific query string value removed. Any existing query string values that exactly match the provided key are removed. +## Cross-Origin Detection + +`GuzzleHttp\Psr7\UriComparator` provides methods to determine if a modified URL should be considered cross-origin. + +### `GuzzleHttp\Psr7\UriComparator::isCrossOrigin` + +`public static function isCrossOrigin(UriInterface $original, UriInterface $modified): bool` + +Determines if a modified URL should be considered cross-origin with respect to an original URL. + ## Reference Resolution `GuzzleHttp\Psr7\UriResolver` provides methods to resolve a URI reference in the context of a base URI according @@ -812,10 +867,12 @@ equivalence or difference of relative references does not mean anything. 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. + ## License Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information. + ## For Enterprise Available as part of the Tidelift Subscription diff --git a/tests/integration/vendor/guzzlehttp/psr7/composer.json b/tests/integration/vendor/guzzlehttp/psr7/composer.json index 885aa1da0..d51dd622e 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/composer.json +++ b/tests/integration/vendor/guzzlehttp/psr7/composer.json @@ -52,7 +52,7 @@ "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0", + "psr/http-message": "^1.1 || ^2.0", "ralouphie/getallheaders": "^3.0" }, "provide": { @@ -60,9 +60,9 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -78,11 +78,15 @@ } }, "extra": { - "branch-alias": { - "dev-master": "2.1-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, "preferred-install": "dist", "sort-packages": true } diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php index 967925f3f..ee8f37882 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/tests/integration/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); } } @@ -191,14 +193,13 @@ public function read($length): string $progressToNext = false; while ($remaining > 0) { - // Progress to the next stream if needed. if ($progressToNext || $this->streams[$this->current]->eof()) { $progressToNext = false; if ($this->current === $total) { break; } - $this->current++; + ++$this->current; } $result = $this->streams[$this->current]->read($remaining); @@ -238,8 +239,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php index 21be8c0a9..2b0eb77be 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php index 7a70ee942..f34722cff 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/CachingStream.php @@ -20,6 +20,11 @@ final class CachingStream implements StreamInterface /** @var int Number of bytes to skip reading due to a write on the buffer */ private $skipReadBytes = 0; + /** + * @var StreamInterface + */ + private $stream; + /** * We will treat the buffer object as the body of the stream * diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php index d78070ae2..6e3d209d0 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/DroppingStream.php @@ -17,6 +17,9 @@ final class DroppingStream implements StreamInterface /** @var int */ private $maxLength; + /** @var StreamInterface */ + private $stream; + /** * @param StreamInterface $stream Underlying stream to decorate. * @param int $maxLength Maximum size before dropping data. diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/FnStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/FnStream.php index c21561843..9fdddb9c6 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/FnStream.php @@ -12,12 +12,13 @@ * Allows for easy testing and extension of a provided stream without needing * to create a concrete class for a simple extension point. */ +#[\AllowDynamicProperties] 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 */ @@ -32,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; } } @@ -44,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'); } /** @@ -98,6 +99,7 @@ public function __toString(): string throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -168,8 +170,6 @@ public function getContents(): string } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Header.php b/tests/integration/vendor/guzzlehttp/psr7/src/Header.php index 0e79a71a8..6e38e0031 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Header.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/Header.php @@ -19,20 +19,22 @@ public static function parse($header): array static $trimmed = "\"' \n\t\r"; $params = $matches = []; - foreach (self::normalize($header) as $val) { - $part = []; - foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { - if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { - $m = $matches[0]; - if (isset($m[1])) { - $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); - } else { - $part[] = trim($m[0], $trimmed); + foreach ((array) $header as $value) { + foreach (self::splitList($value) as $val) { + $part = []; + foreach (preg_split('/;(?=([^"]*"[^"]*")*[^"]*$)/', $val) as $kvp) { + if (preg_match_all('/<[^>]+>|[^=]+/', $kvp, $matches)) { + $m = $matches[0]; + if (isset($m[1])) { + $part[trim($m[0], $trimmed)] = trim($m[1], $trimmed); + } else { + $part[] = trim($m[0], $trimmed); + } } } - } - if ($part) { - $params[] = $part; + if ($part) { + $params[] = $part; + } } } @@ -44,23 +46,86 @@ public static function parse($header): array * headers into an array of headers with no comma separated values. * * @param string|array $header Header to normalize. + * + * @deprecated Use self::splitList() instead. */ public static function normalize($header): array { - if (!is_array($header)) { - return array_map('trim', explode(',', $header)); + $result = []; + foreach ((array) $header as $value) { + foreach (self::splitList($value) as $parsed) { + $result[] = $parsed; + } + } + + return $result; + } + + /** + * Splits a HTTP header defined to contain a comma-separated list into + * each individual value. Empty values will be removed. + * + * Example headers include 'accept', 'cache-control' and 'if-none-match'. + * + * This method must not be used to parse headers that are not defined as + * a list, such as 'user-agent' or 'set-cookie'. + * + * @param string|string[] $values Header value as returned by MessageInterface::getHeader() + * + * @return string[] + */ + public static function splitList($values): array + { + if (!\is_array($values)) { + $values = [$values]; } $result = []; - foreach ($header as $value) { - foreach ((array) $value as $v) { - if (strpos($v, ',') === false) { - $result[] = $v; + foreach ($values as $value) { + if (!\is_string($value)) { + throw new \TypeError('$header must either be a string or an array containing strings.'); + } + + $v = ''; + $isQuoted = false; + $isEscaped = false; + for ($i = 0, $max = \strlen($value); $i < $max; ++$i) { + if ($isEscaped) { + $v .= $value[$i]; + $isEscaped = false; + continue; } - foreach (preg_split('/,(?=([^"]*"[^"]*")*[^"]*$)/', $v) as $vv) { - $result[] = trim($vv); + + if (!$isQuoted && $value[$i] === ',') { + $v = \trim($v); + if ($v !== '') { + $result[] = $v; + } + + $v = ''; + continue; } + + if ($isQuoted && $value[$i] === '\\') { + $isEscaped = true; + $v .= $value[$i]; + + continue; + } + if ($value[$i] === '"') { + $isQuoted = !$isQuoted; + $v .= $value[$i]; + + continue; + } + + $v .= $value[$i]; + } + + $v = \trim($v); + if ($v !== '') { + $result[] = $v; } } diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php b/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php index 30be222fc..73d17e337 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php index 8e3cf1717..599b55da3 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -13,14 +13,17 @@ * 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 { use StreamDecoratorTrait; + /** @var StreamInterface */ + private $stream; + public function __construct(StreamInterface $stream) { $resource = StreamWrapper::getResource($stream); diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php index 6b6042963..f6c84904e 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/LazyOpenStream.php @@ -20,6 +20,11 @@ final class LazyOpenStream implements StreamInterface /** @var string */ private $mode; + /** + * @var StreamInterface + */ + private $stream; + /** * @param string $filename File to lazily open * @param string $mode fopen mode to use when opening the stream @@ -28,6 +33,10 @@ public function __construct(string $filename, string $mode) { $this->filename = $filename; $this->mode = $mode; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->stream); } /** diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php index 9762d38aa..fb2232557 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/LimitStream.php @@ -19,6 +19,9 @@ final class LimitStream implements StreamInterface /** @var int Limit the number of bytes that can be read */ private $limit; + /** @var StreamInterface */ + private $stream; + /** * @param StreamInterface $stream Stream to wrap * @param int $limit Total number of bytes to allow to be read diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/Message.php b/tests/integration/vendor/guzzlehttp/psr7/src/Message.php index 9b825b300..6e6c3e51b 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Message.php +++ b/tests/integration/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(); } /** @@ -67,6 +67,7 @@ public static function bodySummary(MessageInterface $message, int $truncateAt = return null; } + $body->rewind(); $summary = $body->read($truncateAt); $body->rewind(); @@ -76,7 +77,7 @@ public static function bodySummary(MessageInterface $message, int $truncateAt = // Matches any printable character, including unicode characters: // letters, marks, numbers, punctuation, spacing, and separators. - if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary)) { + if (preg_match('/[^\pL\pM\pN\pP\pS\pZ\n\r\t]/u', $summary) !== 0) { return null; } @@ -175,6 +176,9 @@ public static function parseMessage(string $message): array public static function parseRequestUri(string $path, array $headers): string { $hostKey = array_filter(array_keys($headers), function ($k) { + // Numeric array keys are converted to int by PHP. + $k = (string) $k; + return strtolower($k) === 'host'; }); @@ -186,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, '/'); } /** @@ -227,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/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php b/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php index 503c280be..e05ebea88 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/tests/integration/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; } @@ -145,11 +147,9 @@ private function setHeaders(array $headers): void { $this->headerNames = $this->headers = []; foreach ($headers as $header => $value) { - if (is_int($header)) { - // Numeric array keys are converted to int by PHP but having a header name '123' is not forbidden by the spec - // and also allowed in withHeader(). So we need to cast it to string again for the following assertion to pass. - $header = (string) $header; - } + // Numeric array keys are converted to int by PHP. + $header = (string) $header; + $this->assertHeader($header); $value = $this->normalizeHeaderValue($value); $normalized = strtolower($header); @@ -171,14 +171,14 @@ private function setHeaders(array $headers): void private function normalizeHeaderValue($value): array { if (!is_array($value)) { - return $this->trimHeaderValues([$value]); + return $this->trimAndValidateHeaderValues([$value]); } if (count($value) === 0) { throw new \InvalidArgumentException('Header value can not be an empty array.'); } - return $this->trimHeaderValues($value); + return $this->trimAndValidateHeaderValues($value); } /** @@ -195,7 +195,7 @@ private function normalizeHeaderValue($value): array * * @see https://tools.ietf.org/html/rfc7230#section-3.2.4 */ - private function trimHeaderValues(array $values): array + private function trimAndValidateHeaderValues(array $values): array { return array_map(function ($value) { if (!is_scalar($value) && null !== $value) { @@ -205,7 +205,10 @@ private function trimHeaderValues(array $values): array )); } - return trim((string) $value, " \t"); + $trimmed = trim((string) $value, " \t"); + $this->assertValue($trimmed); + + return $trimmed; }, array_values($values)); } @@ -223,12 +226,39 @@ private function assertHeader($header): void )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/', $header)) { + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + throw new \InvalidArgumentException( + sprintf('"%s" is not valid header name.', $header) + ); + } + } + + /** + * @see https://tools.ietf.org/html/rfc7230#section-3.2 + * + * field-value = *( field-content / obs-fold ) + * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] + * field-vchar = VCHAR / obs-text + * VCHAR = %x21-7E + * obs-text = %x80-FF + * obs-fold = CRLF 1*( SP / HTAB ) + */ + private function assertValue(string $value): void + { + // The regular expression intentionally does not support the obs-fold production, because as + // per RFC 7230#3.2.4: + // + // A sender MUST NOT generate a message that includes + // line folding (i.e., that has any field-value that contains a match to + // the obs-fold rule) unless the message is intended for packaging + // within the message/http media type. + // + // 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)) { throw new \InvalidArgumentException( - sprintf( - '"%s" is not valid header name', - $header - ) + sprintf('"%s" is not valid header value.', $value) ); } } diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php b/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php index dfa94251a..b131bdbe7 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/MimeType.php @@ -7,111 +7,1240 @@ final class MimeType { private const MIME_TYPES = [ - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aac' => 'audio/x-aac', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'asc' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'atom' => 'application/atom+xml', - 'avi' => 'video/x-msvideo', - 'bmp' => 'image/bmp', - 'bz2' => 'application/x-bzip2', - 'cer' => 'application/pkix-cert', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'css' => 'text/css', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'deb' => 'application/x-debian-package', - 'doc' => 'application/msword', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dvi' => 'application/x-dvi', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'etx' => 'text/x-setext', - 'flac' => 'audio/flac', - 'flv' => 'video/x-flv', - 'gif' => 'image/gif', - 'gz' => 'application/gzip', - 'htm' => 'text/html', - 'html' => 'text/html', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ini' => 'text/plain', - 'iso' => 'application/x-iso9660-image', - 'jar' => 'application/java-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'latex' => 'application/x-latex', - 'log' => 'text/plain', - 'm4a' => 'audio/mp4', - 'm4v' => 'video/mp4', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mov' => 'video/quicktime', - 'mkv' => 'video/x-matroska', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4v' => 'video/mp4', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'pbm' => 'image/x-portable-bitmap', - 'pdf' => 'application/pdf', - 'pgm' => 'image/x-portable-graymap', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'ppm' => 'image/x-portable-pixmap', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'ps' => 'application/postscript', - 'qt' => 'video/quicktime', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'svg' => 'image/svg+xml', - 'swf' => 'application/x-shockwave-flash', - 'tar' => 'application/x-tar', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'torrent' => 'application/x-bittorrent', - 'ttf' => 'application/x-font-ttf', - 'txt' => 'text/plain', - 'wav' => 'audio/x-wav', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wma' => 'audio/x-ms-wma', - 'wmv' => 'video/x-ms-wmv', - 'woff' => 'application/x-font-woff', - 'wsdl' => 'application/wsdl+xml', - 'xbm' => 'image/x-xbitmap', - 'xls' => 'application/vnd.ms-excel', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xml' => 'application/xml', - 'xpm' => 'image/x-xpixmap', - 'xwd' => 'image/x-xwindowdump', - 'yaml' => 'text/yaml', - 'yml' => 'text/yaml', - 'zip' => 'application/zip', + '1km' => 'application/vnd.1000minds.decision-model+xml', + '3dml' => 'text/vnd.in3d.3dml', + '3ds' => 'image/x-3ds', + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + '3gpp' => 'video/3gpp', + '3mf' => 'model/3mf', + '7z' => 'application/x-7z-compressed', + '7zip' => 'application/x-7z-compressed', + '123' => 'application/vnd.lotus-1-2-3', + 'aab' => 'application/x-authorware-bin', + 'aac' => 'audio/aac', + 'aam' => 'application/x-authorware-map', + 'aas' => 'application/x-authorware-seg', + 'abw' => 'application/x-abiword', + 'ac' => 'application/vnd.nokia.n-gage.ac+xml', + 'ac3' => 'audio/ac3', + 'acc' => 'application/vnd.americandynamics.acc', + 'ace' => 'application/x-ace-compressed', + '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', + 'age' => 'application/vnd.age', + 'ahead' => 'application/vnd.ahead.space', + 'ai' => 'application/pdf', + 'aif' => 'audio/x-aiff', + 'aifc' => 'audio/x-aiff', + 'aiff' => 'audio/x-aiff', + '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', + 'asc' => 'application/pgp-signature', + 'asf' => 'video/x-ms-asf', + 'asm' => 'text/x-asm', + 'aso' => 'application/vnd.accpac.simply.aso', + 'asx' => 'video/x-ms-asf', + 'atc' => 'application/vnd.acucorp', + 'atom' => 'application/atom+xml', + 'atomcat' => 'application/atomcat+xml', + 'atomdeleted' => 'application/atomdeleted+xml', + 'atomsvc' => 'application/atomsvc+xml', + 'atx' => 'application/vnd.antix.game-component', + 'au' => 'audio/x-au', + 'avci' => 'image/avci', + 'avcs' => 'image/avcs', + 'avi' => 'video/x-msvideo', + 'avif' => 'image/avif', + 'aw' => 'application/applixware', + 'azf' => 'application/vnd.airzip.filesecure.azf', + 'azs' => 'application/vnd.airzip.filesecure.azs', + 'azv' => 'image/vnd.airzip.accelerator.azv', + 'azw' => 'application/vnd.amazon.ebook', + 'b16' => 'image/vnd.pco.b16', + 'bat' => 'application/x-msdownload', + 'bcpio' => 'application/x-bcpio', + 'bdf' => 'application/x-font-bdf', + 'bdm' => 'application/vnd.syncml.dm+wbxml', + 'bdoc' => 'application/x-bdoc', + 'bed' => 'application/vnd.realvnc.bed', + 'bh2' => 'application/vnd.fujitsu.oasysprs', + 'bin' => 'application/octet-stream', + 'blb' => 'application/x-blorb', + 'blorb' => 'application/x-blorb', + 'bmi' => 'application/vnd.bmi', + 'bmml' => 'application/vnd.balsamiq.bmml+xml', + 'bmp' => 'image/bmp', + 'book' => 'application/vnd.framemaker', + 'box' => 'application/vnd.previewsystems.box', + 'boz' => 'application/x-bzip2', + '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', + 'bz2' => 'application/x-bzip2', + 'c' => 'text/x-c', + 'c4d' => 'application/vnd.clonk.c4group', + 'c4f' => 'application/vnd.clonk.c4group', + 'c4g' => 'application/vnd.clonk.c4group', + 'c4p' => 'application/vnd.clonk.c4group', + 'c4u' => 'application/vnd.clonk.c4group', + 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', + 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', + 'cab' => 'application/vnd.ms-cab-compressed', + 'caf' => 'audio/x-caf', + 'cap' => 'application/vnd.tcpdump.pcap', + 'car' => 'application/vnd.curl.car', + 'cat' => 'application/vnd.ms-pki.seccat', + 'cb7' => 'application/x-cbr', + 'cba' => 'application/x-cbr', + 'cbr' => 'application/x-cbr', + 'cbt' => 'application/x-cbr', + 'cbz' => 'application/x-cbr', + 'cc' => 'text/x-c', + 'cco' => 'application/x-cocoa', + 'cct' => 'application/x-director', + 'ccxml' => 'application/ccxml+xml', + 'cdbcmsg' => 'application/vnd.contact.cmsg', + 'cdf' => 'application/x-netcdf', + 'cdfx' => 'application/cdfx+xml', + 'cdkey' => 'application/vnd.mediastation.cdkey', + 'cdmia' => 'application/cdmi-capability', + 'cdmic' => 'application/cdmi-container', + 'cdmid' => 'application/cdmi-domain', + 'cdmio' => 'application/cdmi-object', + 'cdmiq' => 'application/cdmi-queue', + 'cdr' => 'application/cdr', + 'cdx' => 'chemical/x-cdx', + 'cdxml' => 'application/vnd.chemdraw+xml', + 'cdy' => 'application/vnd.cinderella', + 'cer' => 'application/pkix-cert', + 'cfs' => 'application/x-cfs-compressed', + 'cgm' => 'image/cgm', + 'chat' => 'application/x-chat', + 'chm' => 'application/vnd.ms-htmlhelp', + 'chrt' => 'application/vnd.kde.kchart', + 'cif' => 'chemical/x-cif', + 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', + 'cil' => 'application/vnd.ms-artgalry', + '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', + 'clkw' => 'application/vnd.crick.clicker.wordbank', + 'clkx' => 'application/vnd.crick.clicker', + 'clp' => 'application/x-msclip', + 'cmc' => 'application/vnd.cosmocaller', + 'cmdf' => 'chemical/x-cmdf', + 'cml' => 'chemical/x-cml', + 'cmp' => 'application/vnd.yellowriver-custom-menu', + 'cmx' => 'image/x-cmx', + 'cod' => 'application/vnd.rim.cod', + 'coffee' => 'text/coffeescript', + 'com' => 'application/x-msdownload', + 'conf' => 'text/plain', + 'cpio' => 'application/x-cpio', + 'cpl' => 'application/cpl+xml', + 'cpp' => 'text/x-c', + 'cpt' => 'application/mac-compactpro', + 'crd' => 'application/x-mscardfile', + 'crl' => 'application/pkix-crl', + 'crt' => 'application/x-x509-ca-cert', + 'crx' => 'application/x-chrome-extension', + 'cryptonote' => 'application/vnd.rig.cryptonote', + 'csh' => 'application/x-csh', + 'csl' => 'application/vnd.citationstyles.style+xml', + 'csml' => 'chemical/x-csml', + 'csp' => 'application/vnd.commonspace', + 'csr' => 'application/octet-stream', + 'css' => 'text/css', + 'cst' => 'application/x-director', + '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', + 'dae' => 'model/vnd.collada+xml', + 'daf' => 'application/vnd.mobius.daf', + 'dart' => 'application/vnd.dart', + 'dataless' => 'application/vnd.fdsn.seed', + 'davmount' => 'application/davmount+xml', + 'dbf' => 'application/vnd.dbf', + 'dbk' => 'application/docbook+xml', + 'dcr' => 'application/x-director', + 'dcurl' => 'text/vnd.curl.dcurl', + 'dd2' => 'application/vnd.oma.dd2+xml', + 'ddd' => 'application/vnd.fujixerox.ddd', + 'ddf' => 'application/vnd.syncml.dmddf+xml', + 'dds' => 'image/vnd.ms-dds', + 'deb' => 'application/x-debian-package', + 'def' => 'text/plain', + 'deploy' => 'application/octet-stream', + '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', + 'disposition-notification' => 'message/disposition-notification', + 'dist' => 'application/octet-stream', + 'distz' => 'application/octet-stream', + 'djv' => 'image/vnd.djvu', + 'djvu' => 'image/vnd.djvu', + 'dll' => 'application/octet-stream', + 'dmg' => 'application/x-apple-diskimage', + 'dmn' => 'application/octet-stream', + 'dmp' => 'application/vnd.tcpdump.pcap', + 'dms' => 'application/octet-stream', + 'dna' => 'application/vnd.dna', + 'doc' => 'application/msword', + 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', + 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + 'dot' => 'application/msword', + 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', + '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', + 'dssc' => 'application/dssc+der', + 'dtb' => 'application/x-dtbook+xml', + 'dtd' => 'application/xml-dtd', + 'dts' => 'audio/vnd.dts', + 'dtshd' => 'audio/vnd.dts.hd', + 'dump' => 'application/octet-stream', + 'dvb' => 'video/vnd.dvb.file', + 'dvi' => 'application/x-dvi', + 'dwd' => 'application/atsc-dwd+xml', + 'dwf' => 'model/vnd.dwf', + 'dwg' => 'image/vnd.dwg', + 'dxf' => 'image/vnd.dxf', + 'dxp' => 'application/vnd.spotfire.dxp', + 'dxr' => 'application/x-director', + 'ear' => 'application/java-archive', + 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', + 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', + 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', + 'ecma' => 'application/ecmascript', + 'edm' => 'application/vnd.novadigm.edm', + 'edx' => 'application/vnd.novadigm.edx', + 'efif' => 'application/vnd.picsel', + 'ei6' => 'application/vnd.pg.osasli', + 'elc' => 'application/octet-stream', + 'emf' => 'image/emf', + 'eml' => 'message/rfc822', + 'emma' => 'application/emma+xml', + 'emotionml' => 'application/emotionml+xml', + 'emz' => 'application/x-msmetafile', + 'eol' => 'audio/vnd.digital-winds', + 'eot' => 'application/vnd.ms-fontobject', + 'eps' => 'application/postscript', + 'epub' => 'application/epub+zip', + 'es3' => 'application/vnd.eszigno3+xml', + 'esa' => 'application/vnd.osgi.subsystem', + 'esf' => 'application/vnd.epson.esf', + 'et3' => 'application/vnd.eszigno3+xml', + 'etx' => 'text/x-setext', + 'eva' => 'application/x-eva', + 'evy' => 'application/x-envoy', + 'exe' => 'application/octet-stream', + 'exi' => 'application/exi', + 'exp' => 'application/express', + 'exr' => 'image/aces', + 'ext' => 'application/vnd.novadigm.ext', + 'ez' => 'application/andrew-inset', + 'ez2' => 'application/vnd.ezpix-album', + 'ez3' => 'application/vnd.ezpix-package', + 'f' => 'text/x-fortran', + 'f4v' => 'video/mp4', + 'f77' => 'text/x-fortran', + 'f90' => 'text/x-fortran', + 'fbs' => 'image/vnd.fastbidsheet', + 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', + 'fcs' => 'application/vnd.isac.fcs', + 'fdf' => 'application/vnd.fdf', + 'fdt' => 'application/fdt+xml', + 'fe_launch' => 'application/vnd.denovo.fcselayout-link', + 'fg5' => 'application/vnd.fujitsu.oasysgp', + 'fgd' => 'application/x-director', + 'fh' => 'image/x-freehand', + 'fh4' => 'image/x-freehand', + 'fh5' => 'image/x-freehand', + 'fh7' => 'image/x-freehand', + 'fhc' => 'image/x-freehand', + 'fig' => 'application/x-xfig', + 'fits' => 'image/fits', + 'flac' => 'audio/x-flac', + 'fli' => 'video/x-fli', + 'flo' => 'application/vnd.micrografx.flo', + 'flv' => 'video/x-flv', + 'flw' => 'application/vnd.kde.kivio', + 'flx' => 'text/vnd.fmi.flexstor', + 'fly' => 'text/vnd.fly', + 'fm' => 'application/vnd.framemaker', + 'fnc' => 'application/vnd.frogans.fnc', + 'fo' => 'application/vnd.software602.filler.form+xml', + 'for' => 'text/x-fortran', + 'fpx' => 'image/vnd.fpx', + 'frame' => 'application/vnd.framemaker', + 'fsc' => 'application/vnd.fsc.weblaunch', + 'fst' => 'image/vnd.fst', + 'ftc' => 'application/vnd.fluxtime.clip', + 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', + 'fvt' => 'video/vnd.fvt', + 'fxp' => 'application/vnd.adobe.fxp', + 'fxpl' => 'application/vnd.adobe.fxp', + 'fzs' => 'application/vnd.fuzzysheet', + 'g2w' => 'application/vnd.geoplan', + 'g3' => 'image/g3fax', + 'g3w' => 'application/vnd.geospace', + 'gac' => 'application/vnd.groove-account', + 'gam' => 'application/x-tads', + 'gbr' => 'application/rpki-ghostbusters', + 'gca' => 'application/x-gca-compressed', + 'gdl' => 'model/vnd.gdl', + 'gdoc' => 'application/vnd.google-apps.document', + 'ged' => 'text/vnd.familysearch.gedcom', + 'geo' => 'application/vnd.dynageo', + 'geojson' => 'application/geo+json', + 'gex' => 'application/vnd.geometry-explorer', + 'ggb' => 'application/vnd.geogebra.file', + 'ggt' => 'application/vnd.geogebra.tool', + 'ghf' => 'application/vnd.groove-help', + 'gif' => 'image/gif', + 'gim' => 'application/vnd.groove-identity-message', + 'glb' => 'model/gltf-binary', + 'gltf' => 'model/gltf+json', + 'gml' => 'application/gml+xml', + 'gmx' => 'application/vnd.gmx', + 'gnumeric' => 'application/x-gnumeric', + 'gpg' => 'application/gpg-keys', + 'gph' => 'application/vnd.flographit', + 'gpx' => 'application/gpx+xml', + 'gqf' => 'application/vnd.grafeq', + 'gqs' => 'application/vnd.grafeq', + 'gram' => 'application/srgs', + 'gramps' => 'application/x-gramps-xml', + 'gre' => 'application/vnd.geometry-explorer', + 'grv' => 'application/vnd.groove-injector', + 'grxml' => 'application/srgs+xml', + 'gsf' => 'application/x-font-ghostscript', + 'gsheet' => 'application/vnd.google-apps.spreadsheet', + 'gslides' => 'application/vnd.google-apps.presentation', + 'gtar' => 'application/x-gtar', + 'gtm' => 'application/vnd.groove-tool-message', + 'gtw' => 'model/vnd.gtw', + 'gv' => 'text/vnd.graphviz', + 'gxf' => 'application/gxf', + 'gxt' => 'application/vnd.geonext', + 'gz' => 'application/gzip', + 'gzip' => 'application/gzip', + 'h' => 'text/x-c', + 'h261' => 'video/h261', + 'h263' => 'video/h263', + 'h264' => 'video/h264', + 'hal' => 'application/vnd.hal+xml', + 'hbci' => 'application/vnd.hbci', + 'hbs' => 'text/x-handlebars-template', + 'hdd' => 'application/x-virtualbox-hdd', + 'hdf' => 'application/x-hdf', + 'heic' => 'image/heic', + 'heics' => 'image/heic-sequence', + 'heif' => 'image/heif', + 'heifs' => 'image/heif-sequence', + 'hej2' => 'image/hej2k', + 'held' => 'application/atsc-held+xml', + 'hh' => 'text/x-c', + 'hjson' => 'application/hjson', + 'hlp' => 'application/winhlp', + 'hpgl' => 'application/vnd.hp-hpgl', + 'hpid' => 'application/vnd.hp-hpid', + 'hps' => 'application/vnd.hp-hps', + 'hqx' => 'application/mac-binhex40', + 'hsj2' => 'image/hsj2', + 'htc' => 'text/x-component', + 'htke' => 'application/vnd.kenameaapp', + 'htm' => 'text/html', + 'html' => 'text/html', + 'hvd' => 'application/vnd.yamaha.hv-dic', + 'hvp' => 'application/vnd.yamaha.hv-voice', + 'hvs' => 'application/vnd.yamaha.hv-script', + 'i2g' => 'application/vnd.intergeo', + 'icc' => 'application/vnd.iccprofile', + 'ice' => 'x-conference/x-cooltalk', + 'icm' => 'application/vnd.iccprofile', + 'ico' => 'image/x-icon', + 'ics' => 'text/calendar', + 'ief' => 'image/ief', + 'ifb' => 'text/calendar', + 'ifm' => 'application/vnd.shana.informed.formdata', + 'iges' => 'model/iges', + 'igl' => 'application/vnd.igloader', + 'igm' => 'application/vnd.insors.igm', + 'igs' => 'model/iges', + 'igx' => 'application/vnd.micrografx.igx', + 'iif' => 'application/vnd.shana.informed.interchange', + 'img' => 'application/octet-stream', + 'imp' => 'application/vnd.accpac.simply.imp', + 'ims' => 'application/vnd.ms-ims', + 'in' => 'text/plain', + 'ini' => 'text/plain', + 'ink' => 'application/inkml+xml', + 'inkml' => 'application/inkml+xml', + 'install' => 'application/x-install-instructions', + 'iota' => 'application/vnd.astraea-software.iota', + 'ipfix' => 'application/ipfix', + 'ipk' => 'application/vnd.shana.informed.package', + 'irm' => 'application/vnd.ibm.rights-management', + 'irp' => 'application/vnd.irepository.package+xml', + 'iso' => 'application/x-iso9660-image', + 'itp' => 'application/vnd.shana.informed.formtemplate', + 'its' => 'application/its+xml', + 'ivp' => 'application/vnd.immervision-ivp', + 'ivu' => 'application/vnd.immervision-ivu', + 'jad' => 'text/vnd.sun.j2me.app-descriptor', + 'jade' => 'text/jade', + 'jam' => 'application/vnd.jam', + 'jar' => 'application/java-archive', + 'jardiff' => 'application/x-java-archive-diff', + 'java' => 'text/x-java-source', + 'jhc' => 'image/jphc', + 'jisp' => 'application/vnd.jisp', + 'jls' => 'image/jls', + 'jlt' => 'application/vnd.hp-jlyt', + 'jng' => 'image/x-jng', + 'jnlp' => 'application/x-java-jnlp-file', + 'joda' => 'application/vnd.joost.joda-archive', + 'jp2' => 'image/jp2', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpf' => 'image/jpx', + 'jpg' => 'image/jpeg', + 'jpg2' => 'image/jp2', + 'jpgm' => 'video/jpm', + 'jpgv' => 'video/jpeg', + 'jph' => 'image/jph', + 'jpm' => 'video/jpm', + 'jpx' => 'image/jpx', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'json5' => 'application/json5', + 'jsonld' => 'application/ld+json', + 'jsonml' => 'application/jsonml+json', + 'jsx' => 'text/jsx', + 'jt' => 'model/jt', + 'jxr' => 'image/jxr', + 'jxra' => 'image/jxra', + 'jxrs' => 'image/jxrs', + 'jxs' => 'image/jxs', + 'jxsc' => 'image/jxsc', + 'jxsi' => 'image/jxsi', + 'jxss' => 'image/jxss', + 'kar' => 'audio/midi', + 'karbon' => 'application/vnd.kde.karbon', + 'kdb' => 'application/octet-stream', + 'kdbx' => 'application/x-keepass2', + 'key' => 'application/x-iwork-keynote-sffkey', + 'kfo' => 'application/vnd.kde.kformula', + 'kia' => 'application/vnd.kidspiration', + 'kml' => 'application/vnd.google-earth.kml+xml', + 'kmz' => 'application/vnd.google-earth.kmz', + 'kne' => 'application/vnd.kinar', + 'knp' => 'application/vnd.kinar', + 'kon' => 'application/vnd.kde.kontour', + 'kpr' => 'application/vnd.kde.kpresenter', + 'kpt' => 'application/vnd.kde.kpresenter', + 'kpxx' => 'application/vnd.ds-keypoint', + 'ksp' => 'application/vnd.kde.kspread', + 'ktr' => 'application/vnd.kahootz', + 'ktx' => 'image/ktx', + 'ktx2' => 'image/ktx2', + 'ktz' => 'application/vnd.kahootz', + 'kwd' => 'application/vnd.kde.kword', + 'kwt' => 'application/vnd.kde.kword', + 'lasxml' => 'application/vnd.las.las+xml', + 'latex' => 'application/x-latex', + 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', + 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', + 'les' => 'application/vnd.hhe.lesson-player', + 'less' => 'text/less', + 'lgr' => 'application/lgr+xml', + 'lha' => 'application/octet-stream', + 'link66' => 'application/vnd.route66.link66+xml', + 'list' => 'text/plain', + 'list3820' => 'application/vnd.ibm.modcap', + 'listafp' => 'application/vnd.ibm.modcap', + 'litcoffee' => 'text/coffeescript', + 'lnk' => 'application/x-ms-shortcut', + 'log' => 'text/plain', + 'lostxml' => 'application/lost+xml', + 'lrf' => 'application/octet-stream', + 'lrm' => 'application/vnd.ms-lrm', + 'ltf' => 'application/vnd.frogans.ltf', + 'lua' => 'text/x-lua', + 'luac' => 'application/x-lua-bytecode', + 'lvp' => 'audio/vnd.lucent.voice', + 'lwp' => 'application/vnd.lotus-wordpro', + 'lzh' => 'application/octet-stream', + 'm1v' => 'video/mpeg', + 'm2a' => 'audio/mpeg', + 'm2v' => 'video/mpeg', + 'm3a' => 'audio/mpeg', + 'm3u' => 'text/plain', + 'm3u8' => 'application/vnd.apple.mpegurl', + 'm4a' => 'audio/x-m4a', + 'm4p' => 'application/mp4', + 'm4s' => 'video/iso.segment', + 'm4u' => 'application/vnd.mpegurl', + 'm4v' => 'video/x-m4v', + 'm13' => 'application/x-msmediaview', + 'm14' => 'application/x-msmediaview', + 'm21' => 'application/mp21', + 'ma' => 'application/mathematica', + 'mads' => 'application/mads+xml', + 'maei' => 'application/mmt-aei+xml', + 'mag' => 'application/vnd.ecowin.chart', + 'maker' => 'application/vnd.framemaker', + 'man' => 'text/troff', + 'manifest' => 'text/cache-manifest', + 'map' => 'application/json', + 'mar' => 'application/octet-stream', + 'markdown' => 'text/markdown', + 'mathml' => 'application/mathml+xml', + 'mb' => 'application/mathematica', + 'mbk' => 'application/vnd.mobius.mbk', + 'mbox' => 'application/mbox', + 'mc1' => 'application/vnd.medcalcdata', + 'mcd' => 'application/vnd.mcd', + 'mcurl' => 'text/vnd.curl.mcurl', + 'md' => 'text/markdown', + 'mdb' => 'application/x-msaccess', + 'mdi' => 'image/vnd.ms-modi', + 'mdx' => 'text/mdx', + 'me' => 'text/troff', + 'mesh' => 'model/mesh', + 'meta4' => 'application/metalink4+xml', + 'metalink' => 'application/metalink+xml', + 'mets' => 'application/mets+xml', + 'mfm' => 'application/vnd.mfmp', + 'mft' => 'application/rpki-manifest', + 'mgp' => 'application/vnd.osgeo.mapguide.package', + 'mgz' => 'application/vnd.proteus.magazine', + 'mid' => 'audio/midi', + 'midi' => 'audio/midi', + 'mie' => 'application/x-mie', + 'mif' => 'application/vnd.mif', + 'mime' => 'message/rfc822', + 'mj2' => 'video/mj2', + 'mjp2' => 'video/mj2', + 'mjs' => 'text/javascript', + 'mk3d' => 'video/x-matroska', + 'mka' => 'audio/x-matroska', + 'mkd' => 'text/x-markdown', + 'mks' => 'video/x-matroska', + 'mkv' => 'video/x-matroska', + 'mlp' => 'application/vnd.dolby.mlp', + 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', + 'mmf' => 'application/vnd.smaf', + 'mml' => 'text/mathml', + 'mmr' => 'image/vnd.fujixerox.edmics-mmr', + 'mng' => 'video/x-mng', + 'mny' => 'application/x-msmoney', + 'mobi' => 'application/x-mobipocket-ebook', + 'mods' => 'application/mods+xml', + 'mov' => 'video/quicktime', + 'movie' => 'video/x-sgi-movie', + 'mp2' => 'audio/mpeg', + 'mp2a' => 'audio/mpeg', + 'mp3' => 'audio/mpeg', + 'mp4' => 'video/mp4', + 'mp4a' => 'audio/mp4', + 'mp4s' => 'application/mp4', + 'mp4v' => 'video/mp4', + 'mp21' => 'application/mp21', + 'mpc' => 'application/vnd.mophun.certificate', + 'mpd' => 'application/dash+xml', + 'mpe' => 'video/mpeg', + 'mpeg' => 'video/mpeg', + 'mpf' => 'application/media-policy-dataset+xml', + 'mpg' => 'video/mpeg', + 'mpg4' => 'video/mp4', + 'mpga' => 'audio/mpeg', + 'mpkg' => 'application/vnd.apple.installer+xml', + 'mpm' => 'application/vnd.blueice.multipass', + 'mpn' => 'application/vnd.mophun.application', + 'mpp' => 'application/vnd.ms-project', + 'mpt' => 'application/vnd.ms-project', + 'mpy' => 'application/vnd.ibm.minipay', + 'mqy' => 'application/vnd.mobius.mqy', + 'mrc' => 'application/marc', + 'mrcx' => 'application/marcxml+xml', + 'ms' => 'text/troff', + 'mscml' => 'application/mediaservercontrol+xml', + 'mseed' => 'application/vnd.fdsn.mseed', + 'mseq' => 'application/vnd.mseq', + 'msf' => 'application/vnd.epson.msf', + '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', + 'msty' => 'application/vnd.muvee.style', + 'mtl' => 'model/mtl', + 'mts' => 'model/vnd.mts', + 'mus' => 'application/vnd.musician', + 'musd' => 'application/mmt-usd+xml', + 'musicxml' => 'application/vnd.recordare.musicxml+xml', + 'mvb' => 'application/x-msmediaview', + 'mvt' => 'application/vnd.mapbox-vector-tile', + 'mwf' => 'application/vnd.mfer', + 'mxf' => 'application/mxf', + 'mxl' => 'application/vnd.recordare.musicxml', + 'mxmf' => 'audio/mobile-xmf', + 'mxml' => 'application/xv+xml', + 'mxs' => 'application/vnd.triscape.mxs', + 'mxu' => 'video/vnd.mpegurl', + 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', + 'n3' => 'text/n3', + 'nb' => 'application/mathematica', + 'nbp' => 'application/vnd.wolfram.player', + 'nc' => 'application/x-netcdf', + 'ncx' => 'application/x-dtbncx+xml', + 'nfo' => 'text/x-nfo', + 'ngdat' => 'application/vnd.nokia.n-gage.data', + 'nitf' => 'application/vnd.nitf', + 'nlu' => 'application/vnd.neurolanguage.nlu', + 'nml' => 'application/vnd.enliven', + 'nnd' => 'application/vnd.noblenet-directory', + 'nns' => 'application/vnd.noblenet-sealer', + 'nnw' => 'application/vnd.noblenet-web', + 'npx' => 'image/vnd.net-fpx', + 'nq' => 'application/n-quads', + 'nsc' => 'application/x-conference', + 'nsf' => 'application/vnd.lotus-notes', + 'nt' => 'application/n-triples', + 'ntf' => 'application/vnd.nitf', + 'numbers' => 'application/x-iwork-numbers-sffnumbers', + 'nzb' => 'application/x-nzb', + 'oa2' => 'application/vnd.fujitsu.oasys2', + 'oa3' => 'application/vnd.fujitsu.oasys3', + 'oas' => 'application/vnd.fujitsu.oasys', + 'obd' => 'application/x-msbinder', + 'obgx' => 'application/vnd.openblox.game+xml', + 'obj' => 'model/obj', + 'oda' => 'application/oda', + 'odb' => 'application/vnd.oasis.opendocument.database', + 'odc' => 'application/vnd.oasis.opendocument.chart', + 'odf' => 'application/vnd.oasis.opendocument.formula', + 'odft' => 'application/vnd.oasis.opendocument.formula-template', + 'odg' => 'application/vnd.oasis.opendocument.graphics', + 'odi' => 'application/vnd.oasis.opendocument.image', + 'odm' => 'application/vnd.oasis.opendocument.text-master', + 'odp' => 'application/vnd.oasis.opendocument.presentation', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + 'odt' => 'application/vnd.oasis.opendocument.text', + 'oga' => 'audio/ogg', + 'ogex' => 'model/vnd.opengex', + 'ogg' => 'audio/ogg', + 'ogv' => 'video/ogg', + 'ogx' => 'application/ogg', + 'omdoc' => 'application/omdoc+xml', + 'onepkg' => 'application/onenote', + 'onetmp' => 'application/onenote', + 'onetoc' => 'application/onenote', + 'onetoc2' => 'application/onenote', + 'opf' => 'application/oebps-package+xml', + 'opml' => 'text/x-opml', + 'oprc' => 'application/vnd.palm', + 'opus' => 'audio/ogg', + 'org' => 'text/x-org', + 'osf' => 'application/vnd.yamaha.openscoreformat', + 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', + 'osm' => 'application/vnd.openstreetmap.data+xml', + 'otc' => 'application/vnd.oasis.opendocument.chart-template', + 'otf' => 'font/otf', + 'otg' => 'application/vnd.oasis.opendocument.graphics-template', + 'oth' => 'application/vnd.oasis.opendocument.text-web', + 'oti' => 'application/vnd.oasis.opendocument.image-template', + 'otp' => 'application/vnd.oasis.opendocument.presentation-template', + 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', + 'ott' => 'application/vnd.oasis.opendocument.text-template', + 'ova' => 'application/x-virtualbox-ova', + 'ovf' => 'application/x-virtualbox-ovf', + 'owl' => 'application/rdf+xml', + 'oxps' => 'application/oxps', + 'oxt' => 'application/vnd.openofficeorg.extension', + 'p' => 'text/x-pascal', + 'p7a' => 'application/x-pkcs7-signature', + 'p7b' => 'application/x-pkcs7-certificates', + 'p7c' => 'application/pkcs7-mime', + 'p7m' => 'application/pkcs7-mime', + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'p8' => 'application/pkcs8', + 'p10' => 'application/x-pkcs10', + 'p12' => 'application/x-pkcs12', + 'pac' => 'application/x-ns-proxy-autoconfig', + 'pages' => 'application/x-iwork-pages-sffpages', + 'pas' => 'text/x-pascal', + 'paw' => 'application/vnd.pawaafile', + 'pbd' => 'application/vnd.powerbuilder6', + 'pbm' => 'image/x-portable-bitmap', + 'pcap' => 'application/vnd.tcpdump.pcap', + 'pcf' => 'application/x-font-pcf', + 'pcl' => 'application/vnd.hp-pcl', + 'pclxl' => 'application/vnd.hp-pclxl', + 'pct' => 'image/x-pict', + 'pcurl' => 'application/vnd.curl.pcurl', + 'pcx' => 'image/x-pcx', + 'pdb' => 'application/x-pilot', + 'pde' => 'text/x-processing', + 'pdf' => 'application/pdf', + 'pem' => 'application/x-x509-user-cert', + 'pfa' => 'application/x-font-type1', + 'pfb' => 'application/x-font-type1', + 'pfm' => 'application/x-font-type1', + 'pfr' => 'application/font-tdpfr', + 'pfx' => 'application/x-pkcs12', + 'pgm' => 'image/x-portable-graymap', + 'pgn' => 'application/x-chess-pgn', + 'pgp' => 'application/pgp', + 'phar' => 'application/octet-stream', + 'php' => 'application/x-httpd-php', + 'php3' => 'application/x-httpd-php', + 'php4' => 'application/x-httpd-php', + 'phps' => 'application/x-httpd-php-source', + 'phtml' => 'application/x-httpd-php', + 'pic' => 'image/x-pict', + 'pkg' => 'application/octet-stream', + 'pki' => 'application/pkixcmp', + 'pkipath' => 'application/pkix-pkipath', + 'pkpass' => 'application/vnd.apple.pkpass', + 'pl' => 'application/x-perl', + 'plb' => 'application/vnd.3gpp.pic-bw-large', + 'plc' => 'application/vnd.mobius.plc', + 'plf' => 'application/vnd.pocketlearn', + 'pls' => 'application/pls+xml', + 'pm' => 'application/x-perl', + 'pml' => 'application/vnd.ctc-posml', + 'png' => 'image/png', + 'pnm' => 'image/x-portable-anymap', + 'portpkg' => 'application/vnd.macports.portpkg', + 'pot' => 'application/vnd.ms-powerpoint', + 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', + 'ppa' => 'application/vnd.ms-powerpoint', + 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', + 'ppd' => 'application/vnd.cups-ppd', + 'ppm' => 'image/x-portable-pixmap', + 'pps' => 'application/vnd.ms-powerpoint', + 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', + 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', + 'ppt' => 'application/powerpoint', + 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', + 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', + 'pqa' => 'application/vnd.palm', + 'prc' => 'model/prc', + 'pre' => 'application/vnd.lotus-freelance', + 'prf' => 'application/pics-rules', + 'provx' => 'application/provenance+xml', + 'ps' => 'application/postscript', + 'psb' => 'application/vnd.3gpp.pic-bw-small', + 'psd' => 'application/x-photoshop', + 'psf' => 'application/x-font-linux-psf', + 'pskcxml' => 'application/pskc+xml', + 'pti' => 'image/prs.pti', + 'ptid' => 'application/vnd.pvi.ptid1', + 'pub' => 'application/x-mspublisher', + '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', + 'qfx' => 'application/vnd.intu.qfx', + 'qps' => 'application/vnd.publishare-delta-tree', + 'qt' => 'video/quicktime', + 'qwd' => 'application/vnd.quark.quarkxpress', + 'qwt' => 'application/vnd.quark.quarkxpress', + 'qxb' => 'application/vnd.quark.quarkxpress', + 'qxd' => 'application/vnd.quark.quarkxpress', + 'qxl' => 'application/vnd.quark.quarkxpress', + 'qxt' => 'application/vnd.quark.quarkxpress', + 'ra' => 'audio/x-realaudio', + 'ram' => 'audio/x-pn-realaudio', + 'raml' => 'application/raml+yaml', + 'rapd' => 'application/route-apd+xml', + 'rar' => 'application/x-rar', + 'ras' => 'image/x-cmu-raster', + 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', + 'rdf' => 'application/rdf+xml', + 'rdz' => 'application/vnd.data-vision.rdz', + 'relo' => 'application/p2p-overlay+xml', + 'rep' => 'application/vnd.businessobjects', + 'res' => 'application/x-dtbresource+xml', + 'rgb' => 'image/x-rgb', + 'rif' => 'application/reginfo+xml', + 'rip' => 'audio/vnd.rip', + 'ris' => 'application/x-research-info-systems', + 'rl' => 'application/resource-lists+xml', + 'rlc' => 'image/vnd.fujixerox.edmics-rlc', + 'rld' => 'application/resource-lists-diff+xml', + 'rm' => 'audio/x-pn-realaudio', + 'rmi' => 'audio/midi', + 'rmp' => 'audio/x-pn-realaudio-plugin', + 'rms' => 'application/vnd.jcp.javame.midlet-rms', + 'rmvb' => 'application/vnd.rn-realmedia-vbr', + 'rnc' => 'application/relax-ng-compact-syntax', + 'rng' => 'application/xml', + 'roa' => 'application/rpki-roa', + 'roff' => 'text/troff', + 'rp9' => 'application/vnd.cloanto.rp9', + 'rpm' => 'audio/x-pn-realaudio-plugin', + 'rpss' => 'application/vnd.nokia.radio-presets', + 'rpst' => 'application/vnd.nokia.radio-preset', + 'rq' => 'application/sparql-query', + 'rs' => 'application/rls-services+xml', + 'rsa' => 'application/x-pkcs7', + 'rsat' => 'application/atsc-rsat+xml', + 'rsd' => 'application/rsd+xml', + 'rsheet' => 'application/urc-ressheet+xml', + 'rss' => 'application/rss+xml', + 'rtf' => 'text/rtf', + 'rtx' => 'text/richtext', + 'run' => 'application/x-makeself', + 'rusd' => 'application/route-usd+xml', + 'rv' => 'video/vnd.rn-realvideo', + 's' => 'text/x-asm', + 's3m' => 'audio/s3m', + 'saf' => 'application/vnd.yamaha.smaf-audio', + 'sass' => 'text/x-sass', + 'sbml' => 'application/sbml+xml', + 'sc' => 'application/vnd.ibm.secure-container', + 'scd' => 'application/x-msschedule', + 'scm' => 'application/vnd.lotus-screencam', + 'scq' => 'application/scvp-cv-request', + 'scs' => 'application/scvp-cv-response', + 'scss' => 'text/x-scss', + 'scurl' => 'text/vnd.curl.scurl', + 'sda' => 'application/vnd.stardivision.draw', + 'sdc' => 'application/vnd.stardivision.calc', + 'sdd' => 'application/vnd.stardivision.impress', + 'sdkd' => 'application/vnd.solent.sdkm+xml', + 'sdkm' => 'application/vnd.solent.sdkm+xml', + 'sdp' => 'application/sdp', + 'sdw' => 'application/vnd.stardivision.writer', + 'sea' => 'application/octet-stream', + 'see' => 'application/vnd.seemail', + 'seed' => 'application/vnd.fdsn.seed', + 'sema' => 'application/vnd.sema', + 'semd' => 'application/vnd.semd', + 'semf' => 'application/vnd.semf', + 'senmlx' => 'application/senml+xml', + 'sensmlx' => 'application/sensml+xml', + 'ser' => 'application/java-serialized-object', + 'setpay' => 'application/set-payment-initiation', + 'setreg' => 'application/set-registration-initiation', + 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', + 'sfs' => 'application/vnd.spotfire.sfs', + 'sfv' => 'text/x-sfv', + 'sgi' => 'image/sgi', + 'sgl' => 'application/vnd.stardivision.writer-global', + 'sgm' => 'text/sgml', + 'sgml' => 'text/sgml', + 'sh' => 'application/x-sh', + 'shar' => 'application/x-shar', + 'shex' => 'text/shex', + 'shf' => 'application/shf+xml', + 'shtml' => 'text/html', + 'sid' => 'image/x-mrsid-image', + 'sieve' => 'application/sieve', + 'sig' => 'application/pgp-signature', + 'sil' => 'audio/silk', + 'silo' => 'model/mesh', + 'sis' => 'application/vnd.symbian.install', + 'sisx' => 'application/vnd.symbian.install', + 'sit' => 'application/x-stuffit', + 'sitx' => 'application/x-stuffitx', + 'siv' => 'application/sieve', + 'skd' => 'application/vnd.koan', + 'skm' => 'application/vnd.koan', + 'skp' => 'application/vnd.koan', + 'skt' => 'application/vnd.koan', + 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', + 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', + 'slim' => 'text/slim', + 'slm' => 'text/slim', + 'sls' => 'application/route-s-tsid+xml', + 'slt' => 'application/vnd.epson.salt', + 'sm' => 'application/vnd.stepmania.stepchart', + 'smf' => 'application/vnd.stardivision.math', + 'smi' => 'application/smil', + 'smil' => 'application/smil', + 'smv' => 'video/x-smv', + 'smzip' => 'application/vnd.stepmania.package', + 'snd' => 'audio/basic', + 'snf' => 'application/x-font-snf', + 'so' => 'application/octet-stream', + 'spc' => 'application/x-pkcs7-certificates', + 'spdx' => 'text/spdx', + 'spf' => 'application/vnd.yamaha.smaf-phrase', + 'spl' => 'application/x-futuresplash', + 'spot' => 'text/vnd.in3d.spot', + 'spp' => 'application/scvp-vp-response', + 'spq' => 'application/scvp-vp-request', + 'spx' => 'audio/ogg', + 'sql' => 'application/x-sql', + 'src' => 'application/x-wais-source', + 'srt' => 'application/x-subrip', + 'sru' => 'application/sru+xml', + 'srx' => 'application/sparql-results+xml', + 'ssdl' => 'application/ssdl+xml', + 'sse' => 'application/vnd.kodak-descriptor', + 'ssf' => 'application/vnd.epson.ssf', + 'ssml' => 'application/ssml+xml', + 'sst' => 'application/octet-stream', + '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', + 'str' => 'application/vnd.pg.format', + 'stw' => 'application/vnd.sun.xml.writer.template', + 'styl' => 'text/stylus', + 'stylus' => 'text/stylus', + 'sub' => 'text/vnd.dvb.subtitle', + 'sus' => 'application/vnd.sus-calendar', + 'susp' => 'application/vnd.sus-calendar', + 'sv4cpio' => 'application/x-sv4cpio', + 'sv4crc' => 'application/x-sv4crc', + 'svc' => 'application/vnd.dvb.service', + 'svd' => 'application/vnd.svd', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + 'swa' => 'application/x-director', + 'swf' => 'application/x-shockwave-flash', + 'swi' => 'application/vnd.aristanetworks.swi', + 'swidtag' => 'application/swid+xml', + 'sxc' => 'application/vnd.sun.xml.calc', + 'sxd' => 'application/vnd.sun.xml.draw', + 'sxg' => 'application/vnd.sun.xml.writer.global', + 'sxi' => 'application/vnd.sun.xml.impress', + 'sxm' => 'application/vnd.sun.xml.math', + 'sxw' => 'application/vnd.sun.xml.writer', + 't' => 'text/troff', + 't3' => 'application/x-t3vm-image', + 't38' => 'image/t38', + 'taglet' => 'application/vnd.mynfc', + 'tao' => 'application/vnd.tao.intent-module-archive', + 'tap' => 'image/vnd.tencent.tap', + 'tar' => 'application/x-tar', + 'tcap' => 'application/vnd.3gpp2.tcap', + 'tcl' => 'application/x-tcl', + 'td' => 'application/urc-targetdesc+xml', + 'teacher' => 'application/vnd.smart.teacher', + 'tei' => 'application/tei+xml', + 'teicorpus' => 'application/tei+xml', + 'tex' => 'application/x-tex', + 'texi' => 'application/x-texinfo', + 'texinfo' => 'application/x-texinfo', + 'text' => 'text/plain', + 'tfi' => 'application/thraud+xml', + 'tfm' => 'application/x-tex-tfm', + 'tfx' => 'image/tiff-fx', + 'tga' => 'image/x-tga', + 'tgz' => 'application/x-tar', + 'thmx' => 'application/vnd.ms-officetheme', + 'tif' => 'image/tiff', + 'tiff' => 'image/tiff', + 'tk' => 'application/x-tcl', + 'tmo' => 'application/vnd.tmobile-livetv', + 'toml' => 'application/toml', + 'torrent' => 'application/x-bittorrent', + 'tpl' => 'application/vnd.groove-tool-template', + 'tpt' => 'application/vnd.trid.tpt', + 'tr' => 'text/troff', + 'tra' => 'application/vnd.trueapp', + 'trig' => 'application/trig', + 'trm' => 'application/x-msterminal', + 'ts' => 'video/mp2t', + 'tsd' => 'application/timestamped-data', + 'tsv' => 'text/tab-separated-values', + 'ttc' => 'font/collection', + 'ttf' => 'font/ttf', + 'ttl' => 'text/turtle', + 'ttml' => 'application/ttml+xml', + 'twd' => 'application/vnd.simtech-mindmapper', + 'twds' => 'application/vnd.simtech-mindmapper', + 'txd' => 'application/vnd.genomatix.tuxedo', + 'txf' => 'application/vnd.mobius.txf', + 'txt' => 'text/plain', + 'u3d' => 'model/u3d', + 'u8dsn' => 'message/global-delivery-status', + 'u8hdr' => 'message/global-headers', + 'u8mdn' => 'message/global-disposition-notification', + 'u8msg' => 'message/global', + 'u32' => 'application/x-authorware-bin', + 'ubj' => 'application/ubjson', + 'udeb' => 'application/x-debian-package', + 'ufd' => 'application/vnd.ufdl', + 'ufdl' => 'application/vnd.ufdl', + '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', + 'uu' => 'text/x-uuencode', + 'uva' => 'audio/vnd.dece.audio', + 'uvd' => 'application/vnd.dece.data', + 'uvf' => 'application/vnd.dece.data', + 'uvg' => 'image/vnd.dece.graphic', + 'uvh' => 'video/vnd.dece.hd', + 'uvi' => 'image/vnd.dece.graphic', + 'uvm' => 'video/vnd.dece.mobile', + 'uvp' => 'video/vnd.dece.pd', + 'uvs' => 'video/vnd.dece.sd', + 'uvt' => 'application/vnd.dece.ttml+xml', + 'uvu' => 'video/vnd.uvvu.mp4', + 'uvv' => 'video/vnd.dece.video', + 'uvva' => 'audio/vnd.dece.audio', + 'uvvd' => 'application/vnd.dece.data', + 'uvvf' => 'application/vnd.dece.data', + 'uvvg' => 'image/vnd.dece.graphic', + 'uvvh' => 'video/vnd.dece.hd', + 'uvvi' => 'image/vnd.dece.graphic', + 'uvvm' => 'video/vnd.dece.mobile', + 'uvvp' => 'video/vnd.dece.pd', + 'uvvs' => 'video/vnd.dece.sd', + 'uvvt' => 'application/vnd.dece.ttml+xml', + 'uvvu' => 'video/vnd.uvvu.mp4', + 'uvvv' => 'video/vnd.dece.video', + 'uvvx' => 'application/vnd.dece.unspecified', + 'uvvz' => 'application/vnd.dece.zip', + 'uvx' => 'application/vnd.dece.unspecified', + 'uvz' => 'application/vnd.dece.zip', + 'vbox' => 'application/x-virtualbox-vbox', + 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', + 'vcard' => 'text/vcard', + 'vcd' => 'application/x-cdlink', + 'vcf' => 'text/x-vcard', + 'vcg' => 'application/vnd.groove-vcard', + 'vcs' => 'text/x-vcalendar', + 'vcx' => 'application/vnd.vcx', + 'vdi' => 'application/x-virtualbox-vdi', + 'vds' => 'model/vnd.sap.vds', + 'vhd' => 'application/x-virtualbox-vhd', + 'vis' => 'application/vnd.visionary', + 'viv' => 'video/vnd.vivo', + 'vlc' => 'application/videolan', + 'vmdk' => 'application/x-virtualbox-vmdk', + 'vob' => 'video/x-ms-vob', + 'vor' => 'application/vnd.stardivision.writer', + 'vox' => 'application/x-authorware-bin', + 'vrml' => 'model/vrml', + 'vsd' => 'application/vnd.visio', + 'vsf' => 'application/vnd.vsf', + 'vss' => 'application/vnd.visio', + 'vst' => 'application/vnd.visio', + 'vsw' => 'application/vnd.visio', + 'vtf' => 'image/vnd.valve.source.texture', + 'vtt' => 'text/vtt', + 'vtu' => 'model/vnd.vtu', + 'vxml' => 'application/voicexml+xml', + 'w3d' => 'application/x-director', + 'wad' => 'application/x-doom', + 'wadl' => 'application/vnd.sun.wadl+xml', + 'war' => 'application/java-archive', + 'wasm' => 'application/wasm', + 'wav' => 'audio/x-wav', + 'wax' => 'audio/x-ms-wax', + 'wbmp' => 'image/vnd.wap.wbmp', + 'wbs' => 'application/vnd.criticaltools.wbs+xml', + 'wbxml' => 'application/wbxml', + 'wcm' => 'application/vnd.ms-works', + 'wdb' => 'application/vnd.ms-works', + 'wdp' => 'image/vnd.ms-photo', + 'weba' => 'audio/webm', + 'webapp' => 'application/x-web-app-manifest+json', + 'webm' => 'video/webm', + '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', + 'wm' => 'video/x-ms-wm', + 'wma' => 'audio/x-ms-wma', + 'wmd' => 'application/x-ms-wmd', + 'wmf' => 'image/wmf', + 'wml' => 'text/vnd.wap.wml', + 'wmlc' => 'application/wmlc', + 'wmls' => 'text/vnd.wap.wmlscript', + 'wmlsc' => 'application/vnd.wap.wmlscriptc', + 'wmv' => 'video/x-ms-wmv', + 'wmx' => 'video/x-ms-wmx', + 'wmz' => 'application/x-msmetafile', + 'woff' => 'font/woff', + 'woff2' => 'font/woff2', + 'word' => 'application/msword', + 'wpd' => 'application/vnd.wordperfect', + 'wpl' => 'application/vnd.ms-wpl', + 'wps' => 'application/vnd.ms-works', + 'wqd' => 'application/vnd.wqd', + 'wri' => 'application/x-mswrite', + 'wrl' => 'model/vrml', + 'wsc' => 'message/vnd.wfa.wsc', + 'wsdl' => 'application/wsdl+xml', + 'wspolicy' => 'application/wspolicy+xml', + 'wtb' => 'application/vnd.webturbo', + 'wvx' => 'video/x-ms-wvx', + 'x3d' => 'model/x3d+xml', + 'x3db' => 'model/x3d+fastinfoset', + 'x3dbz' => 'model/x3d+binary', + 'x3dv' => 'model/x3d-vrml', + 'x3dvz' => 'model/x3d+vrml', + 'x3dz' => 'model/x3d+xml', + 'x32' => 'application/x-authorware-bin', + 'x_b' => 'model/vnd.parasolid.transmit.binary', + 'x_t' => 'model/vnd.parasolid.transmit.text', + 'xaml' => 'application/xaml+xml', + 'xap' => 'application/x-silverlight-app', + 'xar' => 'application/vnd.xara', + 'xav' => 'application/xcap-att+xml', + 'xbap' => 'application/x-ms-xbap', + 'xbd' => 'application/vnd.fujixerox.docuworks.binder', + 'xbm' => 'image/x-xbitmap', + 'xca' => 'application/xcap-caps+xml', + 'xcs' => 'application/calendar+xml', + 'xdf' => 'application/xcap-diff+xml', + 'xdm' => 'application/vnd.syncml.dm+xml', + 'xdp' => 'application/vnd.adobe.xdp+xml', + 'xdssc' => 'application/dssc+xml', + 'xdw' => 'application/vnd.fujixerox.docuworks', + 'xel' => 'application/xcap-el+xml', + 'xenc' => 'application/xenc+xml', + 'xer' => 'application/patch-ops-error+xml', + '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', + 'xl' => 'application/excel', + 'xla' => 'application/vnd.ms-excel', + 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', + 'xlc' => 'application/vnd.ms-excel', + 'xlf' => 'application/xliff+xml', + 'xlm' => 'application/vnd.ms-excel', + 'xls' => 'application/vnd.ms-excel', + 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', + 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', + 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + 'xlt' => 'application/vnd.ms-excel', + 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', + 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', + 'xlw' => 'application/vnd.ms-excel', + 'xm' => 'audio/xm', + 'xml' => 'application/xml', + 'xns' => 'application/xcap-ns+xml', + 'xo' => 'application/vnd.olpc-sugar', + 'xop' => 'application/xop+xml', + 'xpi' => 'application/x-xpinstall', + 'xpl' => 'application/xproc+xml', + 'xpm' => 'image/x-xpixmap', + 'xpr' => 'application/vnd.is-xpr', + 'xps' => 'application/vnd.ms-xpsdocument', + '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', + 'xspf' => 'application/xspf+xml', + 'xul' => 'application/vnd.mozilla.xul+xml', + 'xvm' => 'application/xv+xml', + 'xvml' => 'application/xv+xml', + 'xwd' => 'image/x-xwindowdump', + 'xyz' => 'chemical/x-xyz', + 'xz' => 'application/x-xz', + 'yaml' => 'text/yaml', + 'yang' => 'application/yang', + 'yin' => 'application/yin+xml', + 'yml' => 'text/yaml', + 'ymp' => 'text/x-suse-ymp', + 'z' => 'application/x-compress', + 'z1' => 'application/x-zmachine', + 'z2' => 'application/x-zmachine', + 'z3' => 'application/x-zmachine', + 'z4' => 'application/x-zmachine', + 'z5' => 'application/x-zmachine', + 'z6' => 'application/x-zmachine', + 'z7' => 'application/x-zmachine', + 'z8' => 'application/x-zmachine', + 'zaz' => 'application/vnd.zzazz.deck+xml', + 'zip' => 'application/zip', + 'zir' => 'application/vnd.zul', + 'zirz' => 'application/vnd.zul', + 'zmm' => 'application/vnd.handheld-entertainment+xml', + 'zsh' => 'text/x-scriptzsh', ]; /** * Determines the mimetype of a file by looking at its extension. + * + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromFilename(string $filename): ?string { @@ -121,7 +1250,7 @@ public static function fromFilename(string $filename): ?string /** * Maps a file extensions to a mimetype. * - * @link http://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x/conf/mime.types + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromExtension(string $extension): ?string { diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php index f76d7c614..41c48eef8 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -17,6 +17,9 @@ final class MultipartStream implements StreamInterface /** @var string */ private $boundary; + /** @var StreamInterface */ + private $stream; + /** * @param array $elements Array of associative arrays, each containing a * required "name" key mapping to the form field, @@ -31,7 +34,7 @@ final class MultipartStream implements StreamInterface */ public function __construct(array $elements = [], string $boundary = null) { - $this->boundary = $boundary ?: sha1(uniqid('', true)); + $this->boundary = $boundary ?: bin2hex(random_bytes(20)); $this->stream = $this->createStream($elements); } @@ -57,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"; } /** @@ -68,6 +71,9 @@ protected function createStream(array $elements = []): StreamInterface $stream = new AppendStream(); foreach ($elements as $element) { + if (!is_array($element)) { + throw new \UnexpectedValueException('An array is expected'); + } $this->addElement($stream, $element); } @@ -89,7 +95,7 @@ private function addElement(AppendStream $stream, array $element): void if (empty($element['filename'])) { $uri = $element['contents']->getMetadata('uri'); - if (substr($uri, 0, 6) !== 'php://') { + if ($uri && \is_string($uri) && \substr($uri, 0, 6) !== 'php://' && \substr($uri, 0, 7) !== 'data://') { $element['filename'] = $uri; } } @@ -131,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/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php index 99e25b9e3..161a224f0 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/NoSeekStream.php @@ -13,6 +13,9 @@ final class NoSeekStream implements StreamInterface { use StreamDecoratorTrait; + /** @var StreamInterface */ + private $stream; + public function seek($offset, $whence = SEEK_SET): void { throw new \RuntimeException('Cannot seek a NoSeekStream'); diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/PumpStream.php b/tests/integration/vendor/guzzlehttp/psr7/src/PumpStream.php index e90389c3b..5585190cf 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/PumpStream.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/Query.php b/tests/integration/vendor/guzzlehttp/psr7/src/Query.php index 4fd0ca96d..8b9492797 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Query.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/Query.php @@ -43,7 +43,7 @@ public static function parse(string $str, $urlEncoding = true): array $parts = explode('=', $kvp, 2); $key = $decoder($parts[0]); $value = isset($parts[1]) ? $decoder($parts[1]) : null; - if (!isset($result[$key])) { + if (!array_key_exists($key, $result)) { $result[$key] = $value; } else { if (!is_array($result[$key])) { @@ -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/tests/integration/vendor/guzzlehttp/psr7/src/Request.php b/tests/integration/vendor/guzzlehttp/psr7/src/Request.php index b17af66a2..db29d95d3 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Request.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/Response.php b/tests/integration/vendor/guzzlehttp/psr7/src/Response.php index 4c6ee6f03..8fc11478b 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Response.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php b/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php index 30224018d..8219dba4d 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php b/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php index 6ae3f9beb..c852d96f5 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -80,7 +80,7 @@ public function __construct( /** * Return an UploadedFile instance array. * - * @param array $files A array which respect $_FILES structure + * @param array $files An array which respect $_FILES structure * * @throws InvalidArgumentException for unrecognized values */ @@ -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], - 'error' => $files['error'][$key], - 'name' => $files['name'][$key], - 'type' => $files['type'][$key], + '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/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php b/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php index d389427c6..f730ddacf 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Stream.php +++ b/tests/integration/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 ''; } } @@ -96,13 +98,11 @@ public function getContents(): string throw new \RuntimeException('Stream is detached'); } - $contents = stream_get_contents($this->stream); - - if ($contents === false) { - throw new \RuntimeException('Unable to read stream contents'); + if (!$this->readable) { + throw new \RuntimeException('Cannot read from non-readable stream'); } - return $contents; + return Utils::tryGetContents($this->stream); } public function close(): void @@ -147,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; } @@ -209,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)); } } @@ -229,7 +230,12 @@ public function read($length): string return ''; } - $string = fread($this->stream, $length); + try { + $string = fread($this->stream, $length); + } catch (\Exception $e) { + throw new \RuntimeException('Unable to read from stream', 0, $e); + } + if (false === $string) { throw new \RuntimeException('Unable to read from stream'); } @@ -258,8 +264,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 56d4104d4..96196a3ea 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php index 2a9346403..b3655cb3a 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php b/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php index 3898f7830..fbba7f123 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/Uri.php @@ -14,7 +14,7 @@ * @author Tobias Schultze * @author Matthew Weier O'Phinney */ -class Uri implements UriInterface +class Uri implements UriInterface, \JsonSerializable { /** * Absolute http and https URIs require a host per RFC 7230 Section 2.7 @@ -25,7 +25,7 @@ class Uri implements UriInterface 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 /** * 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,21 +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; } - if ($authority != ''|| $scheme === 'file') { - $uri .= '//' . $authority; + if ($authority != '' && $path != '' && $path[0] != '/') { + $path = '/'.$path; } $uri .= $path; if ($query != '') { - $uri .= '?' . $query; + $uri .= '?'.$query; } if ($fragment != '') { - $uri .= '#' . $fragment; + $uri .= '#'.$fragment; } return $uri; @@ -214,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 { @@ -226,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 { @@ -238,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 { @@ -253,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 { @@ -272,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 { @@ -348,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. */ @@ -370,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; @@ -431,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) { @@ -525,6 +530,11 @@ public function withFragment($fragment): UriInterface return $new; } + public function jsonSerialize(): string + { + return $this->__toString(); + } + /** * Apply parse_url parts to a URI. * @@ -554,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(); @@ -586,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 ); @@ -618,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) ); @@ -655,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; @@ -682,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 ); @@ -702,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 ); @@ -726,8 +736,6 @@ private function validateState(): void if ($this->scheme === '' && false !== strpos(explode('/', $this->path, 2)[0], ':')) { throw new MalformedUriException('A relative URI must not have a path beginning with a segment containing a colon'); } - } elseif (isset($this->path[0]) && $this->path[0] !== '/') { - throw new MalformedUriException('The path of a URI with an authority must start with a slash "/" or be empty'); } } } diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/UriComparator.php b/tests/integration/vendor/guzzlehttp/psr7/src/UriComparator.php new file mode 100644 index 000000000..70c582aa0 --- /dev/null +++ b/tests/integration/vendor/guzzlehttp/psr7/src/UriComparator.php @@ -0,0 +1,52 @@ +getHost(), $modified->getHost()) !== 0) { + return true; + } + + if ($original->getScheme() !== $modified->getScheme()) { + return true; + } + + if (self::computePort($original) !== self::computePort($modified)) { + return true; + } + + return false; + } + + private static function computePort(UriInterface $uri): int + { + $port = $uri->getPort(); + + if (null !== $port) { + return $port; + } + + return 'https' === $uri->getScheme() ? 443 : 80; + } + + private function __construct() + { + // cannot be instantiated + } +} diff --git a/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php index e12971edd..cd4c383aa 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/UriResolver.php b/tests/integration/vendor/guzzlehttp/psr7/src/UriResolver.php index 426e5c9ad..38d5793c7 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/tests/integration/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/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php b/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php index 6cc04ee4f..917c05e30 100644 --- a/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php +++ b/tests/integration/vendor/guzzlehttp/psr7/src/Utils.php @@ -90,6 +90,7 @@ public static function copyToString(StreamInterface $stream, int $maxLen = -1): } $buffer .= $buf; } + return $buffer; } @@ -131,7 +132,7 @@ public static function hash(StreamInterface $stream, string $algo, bool $rawOutp hash_update($ctx, $stream->read(1048576)); } - $out = hash_final($ctx, (bool) $rawOutput); + $out = hash_final($ctx, $rawOutput); $stream->seek($pos); return $out; @@ -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); } @@ -304,10 +306,11 @@ public static function streamFor($resource = '', array $options = []): StreamInt /** @var resource $resource */ if ((\stream_get_meta_data($resource)['uri'] ?? '') === 'php://input') { $stream = self::tryFopen('php://temp', 'w+'); - fwrite($stream, stream_get_contents($resource)); + stream_copy_to_stream($resource, $stream); 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)); } /** @@ -386,6 +390,53 @@ public static function tryFopen(string $filename, string $mode) return $handle; } + /** + * Safely gets the contents of a given stream. + * + * When stream_get_contents fails, PHP normally raises a warning. This + * function adds an error handler that checks for errors and throws an + * exception instead. + * + * @param resource $stream + * + * @throws \RuntimeException if the stream cannot be read + */ + public static function tryGetContents($stream): string + { + $ex = null; + set_error_handler(static function (int $errno, string $errstr) use (&$ex): bool { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $errstr + )); + + return true; + }); + + try { + /** @var string|false $contents */ + $contents = stream_get_contents($stream); + + if ($contents === false) { + $ex = new \RuntimeException('Unable to read stream contents'); + } + } catch (\Throwable $e) { + $ex = new \RuntimeException(sprintf( + 'Unable to read stream contents: %s', + $e->getMessage() + ), 0, $e); + } + + restore_error_handler(); + + if ($ex) { + /** @var $ex \RuntimeException */ + throw $ex; + } + + return $contents; + } + /** * Returns a UriInterface for the given value. * diff --git a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json b/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json deleted file mode 100644 index d69a683b9..000000000 --- a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/php-cs-fixer/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "friendsofphp/php-cs-fixer": "3.2.1" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json b/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json deleted file mode 100644 index bfbc7273b..000000000 --- a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/phpstan/composer.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "phpstan/phpstan": "0.12.81", - "phpstan/phpstan-deprecation-rules": "0.12.6" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json b/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json deleted file mode 100644 index 535a0797d..000000000 --- a/tests/integration/vendor/guzzlehttp/psr7/vendor-bin/psalm/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "require": { - "php": "^7.2.5 || ^8.0", - "psalm/phar": "4.6.2" - }, - "config": { - "preferred-install": "dist" - } -} diff --git a/tests/integration/vendor/psr/http-client/CHANGELOG.md b/tests/integration/vendor/psr/http-client/CHANGELOG.md index e2dc25f51..babba7c7b 100644 --- a/tests/integration/vendor/psr/http-client/CHANGELOG.md +++ b/tests/integration/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/tests/integration/vendor/psr/http-client/README.md b/tests/integration/vendor/psr/http-client/README.md index 6876b8403..84af5c55d 100644 --- a/tests/integration/vendor/psr/http-client/README.md +++ b/tests/integration/vendor/psr/http-client/README.md @@ -7,6 +7,6 @@ Note that this is not a HTTP Client implementation of its own. It is merely abst The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. -[psr-url]: http://www.php-fig.org/psr/psr-18 +[psr-url]: https://www.php-fig.org/psr/psr-18 [package-url]: https://packagist.org/packages/psr/http-client [implementation-url]: https://packagist.org/providers/psr/http-client-implementation diff --git a/tests/integration/vendor/psr/http-client/composer.json b/tests/integration/vendor/psr/http-client/composer.json index c195f8ff1..6fed350be 100644 --- a/tests/integration/vendor/psr/http-client/composer.json +++ b/tests/integration/vendor/psr/http-client/composer.json @@ -7,12 +7,15 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "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" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/tests/integration/vendor/psr/http-factory/.gitignore b/tests/integration/vendor/psr/http-factory/.gitignore deleted file mode 100644 index d8a7996ab..000000000 --- a/tests/integration/vendor/psr/http-factory/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -composer.lock -vendor/ diff --git a/tests/integration/vendor/psr/http-factory/.pullapprove.yml b/tests/integration/vendor/psr/http-factory/.pullapprove.yml deleted file mode 100644 index 8cf081942..000000000 --- a/tests/integration/vendor/psr/http-factory/.pullapprove.yml +++ /dev/null @@ -1,7 +0,0 @@ -extends: default -reviewers: - - - name: contributors - required: 1 - teams: - - http-factory-contributors diff --git a/tests/integration/vendor/psr/http-factory/README.md b/tests/integration/vendor/psr/http-factory/README.md index 41d362a62..bf8913b57 100644 --- a/tests/integration/vendor/psr/http-factory/README.md +++ b/tests/integration/vendor/psr/http-factory/README.md @@ -1,10 +1,12 @@ HTTP Factories ============== -This repository holds all interfaces related to [PSR-17 (HTTP Message Factories)][psr-17]. -Please refer to the specification for a description. +This repository holds all interfaces related to [PSR-17 (HTTP Factories)][psr-url]. -You can find implementations of the specification by looking for packages providing the -[psr/http-factory-implementation](https://packagist.org/providers/psr/http-factory-implementation) virtual package. +Note that this is not a HTTP Factory implementation of its own. It is merely interfaces that describe the components of a HTTP Factory. -[psr-17]: https://www.php-fig.org/psr/psr-17/ +The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. + +[psr-url]: https://www.php-fig.org/psr/psr-17/ +[package-url]: https://packagist.org/packages/psr/http-factory +[implementation-url]: https://packagist.org/providers/psr/http-factory-implementation diff --git a/tests/integration/vendor/psr/http-factory/composer.json b/tests/integration/vendor/psr/http-factory/composer.json index af62b290f..d1bbddeea 100644 --- a/tests/integration/vendor/psr/http-factory/composer.json +++ b/tests/integration/vendor/psr/http-factory/composer.json @@ -15,12 +15,12 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { "php": ">=7.0.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0 || ^2.0" }, "autoload": { "psr-4": { diff --git a/tests/integration/vendor/psr/http-message/README.md b/tests/integration/vendor/psr/http-message/README.md index 28185338f..2668be6c3 100644 --- a/tests/integration/vendor/psr/http-message/README.md +++ b/tests/integration/vendor/psr/http-message/README.md @@ -10,4 +10,7 @@ interface that describes a HTTP message. See the specification for more details. Usage ----- -We'll certainly need some stuff in here. \ No newline at end of file +Before reading the usage guide we recommend reading the PSR-7 interfaces method list: + +* [`PSR-7 Interfaces Method List`](docs/PSR7-Interfaces.md) +* [`PSR-7 Usage Guide`](docs/PSR7-Usage.md) \ No newline at end of file diff --git a/tests/integration/vendor/psr/http-message/composer.json b/tests/integration/vendor/psr/http-message/composer.json index b0d2937a0..c66e5aba4 100644 --- a/tests/integration/vendor/psr/http-message/composer.json +++ b/tests/integration/vendor/psr/http-message/composer.json @@ -7,11 +7,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "autoload": { "psr-4": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/tests/integration/vendor/psr/http-message/docs/PSR7-Interfaces.md b/tests/integration/vendor/psr/http-message/docs/PSR7-Interfaces.md new file mode 100644 index 000000000..3a7e7dda6 --- /dev/null +++ b/tests/integration/vendor/psr/http-message/docs/PSR7-Interfaces.md @@ -0,0 +1,130 @@ +# Interfaces + +The purpose of this list is to help in finding the methods when working with PSR-7. This can be considered as a cheatsheet for PSR-7 interfaces. + +The interfaces defined in PSR-7 are the following: + +| Class Name | Description | +|---|---| +| [Psr\Http\Message\MessageInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagemessageinterface) | Representation of a HTTP message | +| [Psr\Http\Message\RequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagerequestinterface) | Representation of an outgoing, client-side request. | +| [Psr\Http\Message\ServerRequestInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageserverrequestinterface) | Representation of an incoming, server-side HTTP request. | +| [Psr\Http\Message\ResponseInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageresponseinterface) | Representation of an outgoing, server-side response. | +| [Psr\Http\Message\StreamInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessagestreaminterface) | Describes a data stream | +| [Psr\Http\Message\UriInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuriinterface) | Value object representing a URI. | +| [Psr\Http\Message\UploadedFileInterface](http://www.php-fig.org/psr/psr-7/#psrhttpmessageuploadedfileinterface) | Value object representing a file uploaded through an HTTP request. | + +## `Psr\Http\Message\MessageInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getProtocolVersion()` | Retrieve HTTP protocol version | 1.0 or 1.1 | +| `withProtocolVersion($version)` | Returns new message instance with given HTTP protocol version | | +| `getHeaders()` | Retrieve all HTTP Headers | [Request Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Request_fields), [Response Header List](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Response_fields) | +| `hasHeader($name)` | Checks if HTTP Header with given name exists | | +| `getHeader($name)` | Retrieves a array with the values for a single header | | +| `getHeaderLine($name)` | Retrieves a comma-separated string of the values for a single header | | +| `withHeader($name, $value)` | Returns new message instance with given HTTP Header | if the header existed in the original instance, replaces the header value from the original message with the value provided when creating the new instance. | +| `withAddedHeader($name, $value)` | Returns new message instance with appended value to given header | If header already exists value will be appended, if not a new header will be created | +| `withoutHeader($name)` | Removes HTTP Header with given name| | +| `getBody()` | Retrieves the HTTP Message Body | Returns object implementing `StreamInterface`| +| `withBody(StreamInterface $body)` | Returns new message instance with given HTTP Message Body | | + + +## `Psr\Http\Message\RequestInterface` Methods + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getRequestTarget()` | Retrieves the message's request target | origin-form, absolute-form, authority-form, asterisk-form ([RFC7230](https://www.rfc-editor.org/rfc/rfc7230.txt)) | +| `withRequestTarget($requestTarget)` | Return a new message instance with the specific request-target | | +| `getMethod()` | Retrieves the HTTP method of the request. | GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE (defined in [RFC7231](https://tools.ietf.org/html/rfc7231)), PATCH (defined in [RFC5789](https://tools.ietf.org/html/rfc5789)) | +| `withMethod($method)` | Returns a new message instance with the provided HTTP method | | +| `getUri()` | Retrieves the URI instance | | +| `withUri(UriInterface $uri, $preserveHost = false)` | Returns a new message instance with the provided URI | | + + +## `Psr\Http\Message\ServerRequestInterface` Methods + +Same methods as `Psr\Http\Message\RequestInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getServerParams() ` | Retrieve server parameters | Typically derived from `$_SERVER` | +| `getCookieParams()` | Retrieves cookies sent by the client to the server. | Typically derived from `$_COOKIES` | +| `withCookieParams(array $cookies)` | Returns a new request instance with the specified cookies | | +| `withQueryParams(array $query)` | Returns a new request instance with the specified query string arguments | | +| `getUploadedFiles()` | Retrieve normalized file upload data | | +| `withUploadedFiles(array $uploadedFiles)` | Returns a new request instance with the specified uploaded files | | +| `getParsedBody()` | Retrieve any parameters provided in the request body | | +| `withParsedBody($data)` | Returns a new request instance with the specified body parameters | | +| `getAttributes()` | Retrieve attributes derived from the request | | +| `getAttribute($name, $default = null)` | Retrieve a single derived request attribute | | +| `withAttribute($name, $value)` | Returns a new request instance with the specified derived request attribute | | +| `withoutAttribute($name)` | Returns a new request instance that without the specified derived request attribute | | + +## `Psr\Http\Message\ResponseInterface` Methods: + +Same methods as `Psr\Http\Message\MessageInterface` + the following methods: + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStatusCode()` | Gets the response status code. | | +| `withStatus($code, $reasonPhrase = '')` | Returns a new response instance with the specified status code and, optionally, reason phrase. | | +| `getReasonPhrase()` | Gets the response reason phrase associated with the status code. | | + +## `Psr\Http\Message\StreamInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `__toString()` | Reads all data from the stream into a string, from the beginning to end. | | +| `close()` | Closes the stream and any underlying resources. | | +| `detach()` | Separates any underlying resources from the stream. | | +| `getSize()` | Get the size of the stream if known. | | +| `eof()` | Returns true if the stream is at the end of the stream.| | +| `isSeekable()` | Returns whether or not the stream is seekable. | | +| `seek($offset, $whence = SEEK_SET)` | Seek to a position in the stream. | | +| `rewind()` | Seek to the beginning of the stream. | | +| `isWritable()` | Returns whether or not the stream is writable. | | +| `write($string)` | Write data to the stream. | | +| `isReadable()` | Returns whether or not the stream is readable. | | +| `read($length)` | Read data from the stream. | | +| `getContents()` | Returns the remaining contents in a string | | +| `getMetadata($key = null)()` | Get stream metadata as an associative array or retrieve a specific key. | | + +## `Psr\Http\Message\UriInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getScheme()` | Retrieve the scheme component of the URI. | | +| `getAuthority()` | Retrieve the authority component of the URI. | | +| `getUserInfo()` | Retrieve the user information component of the URI. | | +| `getHost()` | Retrieve the host component of the URI. | | +| `getPort()` | Retrieve the port component of the URI. | | +| `getPath()` | Retrieve the path component of the URI. | | +| `getQuery()` | Retrieve the query string of the URI. | | +| `getFragment()` | Retrieve the fragment component of the URI. | | +| `withScheme($scheme)` | Return an instance with the specified scheme. | | +| `withUserInfo($user, $password = null)` | Return an instance with the specified user information. | | +| `withHost($host)` | Return an instance with the specified host. | | +| `withPort($port)` | Return an instance with the specified port. | | +| `withPath($path)` | Return an instance with the specified path. | | +| `withQuery($query)` | Return an instance with the specified query string. | | +| `withFragment($fragment)` | Return an instance with the specified URI fragment. | | +| `__toString()` | Return the string representation as a URI reference. | | + +## `Psr\Http\Message\UploadedFileInterface` Methods + +| Method Name | Description | Notes | +|------------------------------------| ----------- | ----- | +| `getStream()` | Retrieve a stream representing the uploaded file. | | +| `moveTo($targetPath)` | Move the uploaded file to a new location. | | +| `getSize()` | Retrieve the file size. | | +| `getError()` | Retrieve the error associated with the uploaded file. | | +| `getClientFilename()` | Retrieve the filename sent by the client. | | +| `getClientMediaType()` | Retrieve the media type sent by the client. | | + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + diff --git a/tests/integration/vendor/psr/http-message/docs/PSR7-Usage.md b/tests/integration/vendor/psr/http-message/docs/PSR7-Usage.md new file mode 100644 index 000000000..b6d048a34 --- /dev/null +++ b/tests/integration/vendor/psr/http-message/docs/PSR7-Usage.md @@ -0,0 +1,159 @@ +### PSR-7 Usage + +All PSR-7 applications comply with these interfaces +They were created to establish a standard between middleware implementations. + +> `RequestInterface`, `ServerRequestInterface`, `ResponseInterface` extend `MessageInterface` because the `Request` and the `Response` are `HTTP Messages`. +> When using `ServerRequestInterface`, both `RequestInterface` and `Psr\Http\Message\MessageInterface` methods are considered. + + +The following examples will illustrate how basic operations are done in PSR-7. + +##### Examples + + +For this examples to work (at least) a PSR-7 implementation package is required. (eg: zendframework/zend-diactoros, guzzlehttp/psr7, slim/slim, etc) +All PSR-7 implementations should have the same behaviour. + +The following will be assumed: +`$request` is an object of `Psr\Http\Message\RequestInterface` and + +`$response` is an object implementing `Psr\Http\Message\RequestInterface` + + +### Working with HTTP Headers + +#### Adding headers to response: + +```php +$response->withHeader('My-Custom-Header', 'My Custom Message'); +``` + +#### Appending values to headers + +```php +$response->withAddedHeader('My-Custom-Header', 'The second message'); +``` + +#### Checking if header exists: + +```php +$request->hasHeader('My-Custom-Header'); // will return false +$response->hasHeader('My-Custom-Header'); // will return true +``` + +> Note: My-Custom-Header was only added in the Response + +#### Getting comma-separated values from a header (also applies to request) + +```php +// getting value from request headers +$request->getHeaderLine('Content-Type'); // will return: "text/html; charset=UTF-8" +// getting value from response headers +$response->getHeaderLine('My-Custom-Header'); // will return: "My Custom Message; The second message" +``` + +#### Getting array of value from a header (also applies to request) +```php +// getting value from request headers +$request->getHeader('Content-Type'); // will return: ["text/html", "charset=UTF-8"] +// getting value from response headers +$response->getHeader('My-Custom-Header'); // will return: ["My Custom Message", "The second message"] +``` + +#### Removing headers from HTTP Messages +```php +// removing a header from Request, removing deprecated "Content-MD5" header +$request->withoutHeader('Content-MD5'); + +// removing a header from Response +// effect: the browser won't know the size of the stream +// the browser will download the stream till it ends +$response->withoutHeader('Content-Length'); +``` + +### Working with HTTP Message Body + +When working with the PSR-7 there are two methods of implementation: +#### 1. Getting the body separately + +> This method makes the body handling easier to understand and is useful when repeatedly calling body methods. (You only call `getBody()` once). Using this method mistakes like `$response->write()` are also prevented. + +```php +$body = $response->getBody(); +// operations on body, eg. read, write, seek +// ... +// replacing the old body +$response->withBody($body); +// this last statement is optional as we working with objects +// in this case the "new" body is same with the "old" one +// the $body variable has the same value as the one in $request, only the reference is passed +``` + +#### 2. Working directly on response + +> This method is useful when only performing few operations as the `$request->getBody()` statement fragment is required + +```php +$response->getBody()->write('hello'); +``` + +### Getting the body contents + +The following snippet gets the contents of a stream contents. +> Note: Streams must be rewinded, if content was written into streams, it will be ignored when calling `getContents()` because the stream pointer is set to the last character, which is `\0` - meaning end of stream. +```php +$body = $response->getBody(); +$body->rewind(); // or $body->seek(0); +$bodyText = $body->getContents(); +``` +> Note: If `$body->seek(1)` is called before `$body->getContents()`, the first character will be ommited as the starting pointer is set to `1`, not `0`. This is why using `$body->rewind()` is recommended. + +### Append to body + +```php +$response->getBody()->write('Hello'); // writing directly +$body = $request->getBody(); // which is a `StreamInterface` +$body->write('xxxxx'); +``` + +### Prepend to body +Prepending is different when it comes to streams. The content must be copied before writing the content to be prepended. +The following example will explain the behaviour of streams. + +```php +// assuming our response is initially empty +$body = $repsonse->getBody(); +// writing the string "abcd" +$body->write('abcd'); + +// seeking to start of stream +$body->seek(0); +// writing 'ef' +$body->write('ef'); // at this point the stream contains "efcd" +``` + +#### Prepending by rewriting separately + +```php +// assuming our response body stream only contains: "abcd" +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // abcd +// seeking the stream to beginning +$body->rewind(); +$body->write('ef'); // stream contains "efcd" +$body->write($contents); // stream contains "efabcd" +``` + +> Note: `getContents()` seeks the stream while reading it, therefore if the second `rewind()` method call was not present the stream would have resulted in `abcdefabcd` because the `write()` method appends to stream if not preceeded by `rewind()` or `seek(0)`. + +#### Prepending by using contents as a string +```php +$body = $response->getBody(); +$body->rewind(); +$contents = $body->getContents(); // efabcd +$contents = 'ef'.$contents; +$body->rewind(); +$body->write($contents); +``` diff --git a/tests/integration/vendor/psr/http-message/src/MessageInterface.php b/tests/integration/vendor/psr/http-message/src/MessageInterface.php index dd46e5ec8..a83c98518 100644 --- a/tests/integration/vendor/psr/http-message/src/MessageInterface.php +++ b/tests/integration/vendor/psr/http-message/src/MessageInterface.php @@ -23,7 +23,7 @@ interface MessageInterface * * @return string HTTP protocol version. */ - public function getProtocolVersion(); + public function getProtocolVersion(): string; /** * Return an instance with the specified HTTP protocol version. @@ -38,7 +38,7 @@ public function getProtocolVersion(); * @param string $version HTTP protocol version * @return static */ - public function withProtocolVersion($version); + public function withProtocolVersion(string $version): MessageInterface; /** * Retrieves all message header values. @@ -65,7 +65,7 @@ public function withProtocolVersion($version); * key MUST be a header name, and each value MUST be an array of strings * for that header. */ - public function getHeaders(); + public function getHeaders(): array; /** * Checks if a header exists by the given case-insensitive name. @@ -75,7 +75,7 @@ public function getHeaders(); * name using a case-insensitive string comparison. Returns false if * no matching header name is found in the message. */ - public function hasHeader($name); + public function hasHeader(string $name): bool; /** * Retrieves a message header value by the given case-insensitive name. @@ -91,7 +91,7 @@ public function hasHeader($name); * header. If the header does not appear in the message, this method MUST * return an empty array. */ - public function getHeader($name); + public function getHeader(string $name): array; /** * Retrieves a comma-separated string of the values for a single header. @@ -112,7 +112,7 @@ public function getHeader($name); * concatenated together using a comma. If the header does not appear in * the message, this method MUST return an empty string. */ - public function getHeaderLine($name); + public function getHeaderLine(string $name): string; /** * Return an instance with the provided value replacing the specified header. @@ -129,7 +129,7 @@ public function getHeaderLine($name); * @return static * @throws \InvalidArgumentException for invalid header names or values. */ - public function withHeader($name, $value); + public function withHeader(string $name, $value): MessageInterface; /** * Return an instance with the specified header appended with the given value. @@ -147,7 +147,7 @@ public function withHeader($name, $value); * @return static * @throws \InvalidArgumentException for invalid header names or values. */ - public function withAddedHeader($name, $value); + public function withAddedHeader(string $name, $value): MessageInterface; /** * Return an instance without the specified header. @@ -161,14 +161,14 @@ public function withAddedHeader($name, $value); * @param string $name Case-insensitive header field name to remove. * @return static */ - public function withoutHeader($name); + public function withoutHeader(string $name): MessageInterface; /** * Gets the body of the message. * * @return StreamInterface Returns the body as a stream. */ - public function getBody(); + public function getBody(): StreamInterface; /** * Return an instance with the specified message body. @@ -183,5 +183,5 @@ public function getBody(); * @return static * @throws \InvalidArgumentException When the body is not valid. */ - public function withBody(StreamInterface $body); + public function withBody(StreamInterface $body): MessageInterface; } diff --git a/tests/integration/vendor/psr/http-message/src/RequestInterface.php b/tests/integration/vendor/psr/http-message/src/RequestInterface.php index a96d4fd63..33f85e559 100644 --- a/tests/integration/vendor/psr/http-message/src/RequestInterface.php +++ b/tests/integration/vendor/psr/http-message/src/RequestInterface.php @@ -39,7 +39,7 @@ interface RequestInterface extends MessageInterface * * @return string */ - public function getRequestTarget(); + public function getRequestTarget(): string; /** * Return an instance with the specific request-target. @@ -55,17 +55,18 @@ public function getRequestTarget(); * * @link http://tools.ietf.org/html/rfc7230#section-5.3 (for the various * request-target forms allowed in request messages) - * @param mixed $requestTarget + * @param string $requestTarget * @return static */ - public function withRequestTarget($requestTarget); + public function withRequestTarget(string $requestTarget): RequestInterface; + /** * Retrieves the HTTP method of the request. * * @return string Returns the request method. */ - public function getMethod(); + public function getMethod(): string; /** * Return an instance with the provided HTTP method. @@ -82,7 +83,7 @@ public function getMethod(); * @return static * @throws \InvalidArgumentException for invalid HTTP methods. */ - public function withMethod($method); + public function withMethod(string $method): RequestInterface; /** * Retrieves the URI instance. @@ -93,7 +94,7 @@ public function withMethod($method); * @return UriInterface Returns a UriInterface instance * representing the URI of the request. */ - public function getUri(); + public function getUri(): UriInterface; /** * Returns an instance with the provided URI. @@ -125,5 +126,5 @@ public function getUri(); * @param bool $preserveHost Preserve the original state of the Host header. * @return static */ - public function withUri(UriInterface $uri, $preserveHost = false); + public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface; } diff --git a/tests/integration/vendor/psr/http-message/src/ResponseInterface.php b/tests/integration/vendor/psr/http-message/src/ResponseInterface.php index c306514e6..e9299a914 100644 --- a/tests/integration/vendor/psr/http-message/src/ResponseInterface.php +++ b/tests/integration/vendor/psr/http-message/src/ResponseInterface.php @@ -27,7 +27,7 @@ interface ResponseInterface extends MessageInterface * * @return int Status code. */ - public function getStatusCode(); + public function getStatusCode(): int; /** * Return an instance with the specified status code and, optionally, reason phrase. @@ -49,7 +49,7 @@ public function getStatusCode(); * @return static * @throws \InvalidArgumentException For invalid status code arguments. */ - public function withStatus($code, $reasonPhrase = ''); + public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface; /** * Gets the response reason phrase associated with the status code. @@ -64,5 +64,5 @@ public function withStatus($code, $reasonPhrase = ''); * @link http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml * @return string Reason phrase; must return an empty string if none present. */ - public function getReasonPhrase(); + public function getReasonPhrase(): string; } diff --git a/tests/integration/vendor/psr/http-message/src/ServerRequestInterface.php b/tests/integration/vendor/psr/http-message/src/ServerRequestInterface.php index 02512340a..8625d0e10 100644 --- a/tests/integration/vendor/psr/http-message/src/ServerRequestInterface.php +++ b/tests/integration/vendor/psr/http-message/src/ServerRequestInterface.php @@ -51,7 +51,7 @@ interface ServerRequestInterface extends RequestInterface * * @return array */ - public function getServerParams(); + public function getServerParams(): array; /** * Retrieve cookies. @@ -63,7 +63,7 @@ public function getServerParams(); * * @return array */ - public function getCookieParams(); + public function getCookieParams(): array; /** * Return an instance with the specified cookies. @@ -82,7 +82,7 @@ public function getCookieParams(); * @param array $cookies Array of key/value pairs representing cookies. * @return static */ - public function withCookieParams(array $cookies); + public function withCookieParams(array $cookies): ServerRequestInterface; /** * Retrieve query string arguments. @@ -96,7 +96,7 @@ public function withCookieParams(array $cookies); * * @return array */ - public function getQueryParams(); + public function getQueryParams(): array; /** * Return an instance with the specified query string arguments. @@ -120,7 +120,7 @@ public function getQueryParams(); * $_GET. * @return static */ - public function withQueryParams(array $query); + public function withQueryParams(array $query): ServerRequestInterface; /** * Retrieve normalized file upload data. @@ -134,7 +134,7 @@ public function withQueryParams(array $query); * @return array An array tree of UploadedFileInterface instances; an empty * array MUST be returned if no data is present. */ - public function getUploadedFiles(); + public function getUploadedFiles(): array; /** * Create a new instance with the specified uploaded files. @@ -147,7 +147,7 @@ public function getUploadedFiles(); * @return static * @throws \InvalidArgumentException if an invalid structure is provided. */ - public function withUploadedFiles(array $uploadedFiles); + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface; /** * Retrieve any parameters provided in the request body. @@ -194,7 +194,7 @@ public function getParsedBody(); * @throws \InvalidArgumentException if an unsupported argument type is * provided. */ - public function withParsedBody($data); + public function withParsedBody($data): ServerRequestInterface; /** * Retrieve attributes derived from the request. @@ -207,7 +207,7 @@ public function withParsedBody($data); * * @return array Attributes derived from the request. */ - public function getAttributes(); + public function getAttributes(): array; /** * Retrieve a single derived request attribute. @@ -224,7 +224,7 @@ public function getAttributes(); * @param mixed $default Default value to return if the attribute does not exist. * @return mixed */ - public function getAttribute($name, $default = null); + public function getAttribute(string $name, $default = null); /** * Return an instance with the specified derived request attribute. @@ -241,7 +241,7 @@ public function getAttribute($name, $default = null); * @param mixed $value The value of the attribute. * @return static */ - public function withAttribute($name, $value); + public function withAttribute(string $name, $value): ServerRequestInterface; /** * Return an instance that removes the specified derived request attribute. @@ -257,5 +257,5 @@ public function withAttribute($name, $value); * @param string $name The attribute name. * @return static */ - public function withoutAttribute($name); + public function withoutAttribute(string $name): ServerRequestInterface; } diff --git a/tests/integration/vendor/psr/http-message/src/StreamInterface.php b/tests/integration/vendor/psr/http-message/src/StreamInterface.php index f68f39126..a62aabb82 100644 --- a/tests/integration/vendor/psr/http-message/src/StreamInterface.php +++ b/tests/integration/vendor/psr/http-message/src/StreamInterface.php @@ -25,14 +25,14 @@ interface StreamInterface * @see http://php.net/manual/en/language.oop5.magic.php#object.tostring * @return string */ - public function __toString(); + public function __toString(): string; /** * Closes the stream and any underlying resources. * * @return void */ - public function close(); + public function close(): void; /** * Separates any underlying resources from the stream. @@ -48,7 +48,7 @@ public function detach(); * * @return int|null Returns the size in bytes if known, or null if unknown. */ - public function getSize(); + public function getSize(): ?int; /** * Returns the current position of the file read/write pointer @@ -56,21 +56,21 @@ public function getSize(); * @return int Position of the file pointer * @throws \RuntimeException on error. */ - public function tell(); + public function tell(): int; /** * Returns true if the stream is at the end of the stream. * * @return bool */ - public function eof(); + public function eof(): bool; /** * Returns whether or not the stream is seekable. * * @return bool */ - public function isSeekable(); + public function isSeekable(): bool; /** * Seek to a position in the stream. @@ -84,7 +84,7 @@ public function isSeekable(); * SEEK_END: Set position to end-of-stream plus offset. * @throws \RuntimeException on failure. */ - public function seek($offset, $whence = SEEK_SET); + public function seek(int $offset, int $whence = SEEK_SET): void; /** * Seek to the beginning of the stream. @@ -96,14 +96,14 @@ public function seek($offset, $whence = SEEK_SET); * @link http://www.php.net/manual/en/function.fseek.php * @throws \RuntimeException on failure. */ - public function rewind(); + public function rewind(): void; /** * Returns whether or not the stream is writable. * * @return bool */ - public function isWritable(); + public function isWritable(): bool; /** * Write data to the stream. @@ -112,14 +112,14 @@ public function isWritable(); * @return int Returns the number of bytes written to the stream. * @throws \RuntimeException on failure. */ - public function write($string); + public function write(string $string): int; /** * Returns whether or not the stream is readable. * * @return bool */ - public function isReadable(); + public function isReadable(): bool; /** * Read data from the stream. @@ -131,7 +131,7 @@ public function isReadable(); * if no bytes are available. * @throws \RuntimeException if an error occurs. */ - public function read($length); + public function read(int $length): string; /** * Returns the remaining contents in a string @@ -140,7 +140,7 @@ public function read($length); * @throws \RuntimeException if unable to read or an error occurs while * reading. */ - public function getContents(); + public function getContents(): string; /** * Get stream metadata as an associative array or retrieve a specific key. @@ -149,10 +149,10 @@ public function getContents(); * stream_get_meta_data() function. * * @link http://php.net/manual/en/function.stream-get-meta-data.php - * @param string $key Specific metadata to retrieve. + * @param string|null $key Specific metadata to retrieve. * @return array|mixed|null Returns an associative array if no key is * provided. Returns a specific key value if a key is provided and the * value is found, or null if the key is not found. */ - public function getMetadata($key = null); + public function getMetadata(?string $key = null); } diff --git a/tests/integration/vendor/psr/http-message/src/UploadedFileInterface.php b/tests/integration/vendor/psr/http-message/src/UploadedFileInterface.php index f8a6901e0..dd19d6538 100644 --- a/tests/integration/vendor/psr/http-message/src/UploadedFileInterface.php +++ b/tests/integration/vendor/psr/http-message/src/UploadedFileInterface.php @@ -28,7 +28,7 @@ interface UploadedFileInterface * @throws \RuntimeException in cases when no stream is available or can be * created. */ - public function getStream(); + public function getStream(): StreamInterface; /** * Move the uploaded file to a new location. @@ -62,7 +62,7 @@ public function getStream(); * @throws \RuntimeException on any error during the move operation, or on * the second or subsequent call to the method. */ - public function moveTo($targetPath); + public function moveTo(string $targetPath): void; /** * Retrieve the file size. @@ -73,7 +73,7 @@ public function moveTo($targetPath); * * @return int|null The file size in bytes or null if unknown. */ - public function getSize(); + public function getSize(): ?int; /** * Retrieve the error associated with the uploaded file. @@ -89,7 +89,7 @@ public function getSize(); * @see http://php.net/manual/en/features.file-upload.errors.php * @return int One of PHP's UPLOAD_ERR_XXX constants. */ - public function getError(); + public function getError(): int; /** * Retrieve the filename sent by the client. @@ -104,7 +104,7 @@ public function getError(); * @return string|null The filename sent by the client or null if none * was provided. */ - public function getClientFilename(); + public function getClientFilename(): ?string; /** * Retrieve the media type sent by the client. @@ -119,5 +119,5 @@ public function getClientFilename(); * @return string|null The media type sent by the client or null if none * was provided. */ - public function getClientMediaType(); + public function getClientMediaType(): ?string; } diff --git a/tests/integration/vendor/psr/http-message/src/UriInterface.php b/tests/integration/vendor/psr/http-message/src/UriInterface.php index 9d7ab9eae..15e2cf286 100644 --- a/tests/integration/vendor/psr/http-message/src/UriInterface.php +++ b/tests/integration/vendor/psr/http-message/src/UriInterface.php @@ -1,4 +1,5 @@ use) as $statement) { $use .= sprintf('use %s;', $statement)."\n"; } @@ -81,7 +81,7 @@ public function build(): string foreach ($this->methods as $method) { $lines = explode("\n", $method->getContent()); foreach ($lines as $line) { - $body .= ' '.$line."\n"; + $body .= ($line ? ' '.$line : '')."\n"; } } @@ -89,11 +89,9 @@ public function build(): string namespace NAMESPACE; -REQUIRE -USE - +REQUIREUSE /** - * This class is automatically generated to help creating config. + * This class is automatically generated to help in creating a config. */ class CLASS IMPLEMENTS { @@ -124,14 +122,15 @@ public function addMethod(string $name, string $body, array $params = []): void $this->methods[] = new Method(strtr($body, ['NAME' => $this->camelCase($name)] + $params)); } - public function addProperty(string $name, string $classType = null): Property + public function addProperty(string $name, string $classType = null, string $defaultValue = null): Property { $property = new Property($name, '_' !== $name[0] ? $this->camelCase($name) : $name); if (null !== $classType) { $property->setType($classType); } $this->properties[] = $property; - $property->setContent(sprintf('private $%s;', $property->getName())); + $defaultValue = null !== $defaultValue ? sprintf(' = %s', $defaultValue) : ''; + $property->setContent(sprintf('private $%s%s;', $property->getName(), $defaultValue)); return $property; } diff --git a/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php index 979c95522..c63917bcb 100644 --- a/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php +++ b/tests/integration/vendor/symfony/config/Builder/ConfigBuilderGenerator.php @@ -31,6 +31,9 @@ */ class ConfigBuilderGenerator implements ConfigBuilderGeneratorInterface { + /** + * @var ClassBuilder[] + */ private $classes; private $outputDir; @@ -89,6 +92,9 @@ private function writeClasses(): void foreach ($this->classes as $class) { $this->buildConstructor($class); $this->buildToArray($class); + if ($class->getProperties()) { + $class->addProperty('_usedProperties', null, '[]'); + } $this->buildSetExtraKey($class); file_put_contents($this->getFullPath($class), $class->build()); @@ -130,13 +136,39 @@ private function handleArrayNode(ArrayNode $node, ClassBuilder $class, string $n $class->addRequire($childClass); $this->classes[] = $childClass; - $property = $class->addProperty($node->getName(), $childClass->getFqcn()); - $body = ' + $hasNormalizationClosures = $this->hasNormalizationClosures($node); + $property = $class->addProperty( + $node->getName(), + $this->getType($childClass->getFqcn(), $hasNormalizationClosures) + ); + $body = $hasNormalizationClosures ? ' +/** + * @return CLASS|$this + */ +public function NAME($value = []) +{ + if (!\is_array($value)) { + $this->_usedProperties[\'PROPERTY\'] = true; + $this->PROPERTY = $value; + + return $this; + } + + if (!$this->PROPERTY instanceof CLASS) { + $this->_usedProperties[\'PROPERTY\'] = true; + $this->PROPERTY = new CLASS($value); + } elseif (0 < \func_num_args()) { + throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'); + } + + return $this->PROPERTY; +}' : ' public function NAME(array $value = []): CLASS { if (null === $this->PROPERTY) { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY = new CLASS($value); - } elseif ([] !== $value) { + } elseif (0 < \func_num_args()) { throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'); } @@ -160,6 +192,7 @@ private function handleVariableNode(VariableNode $node, ClassBuilder $class): vo */ public function NAME($valueDEFAULT): self { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY = $value; return $this; @@ -186,6 +219,7 @@ private function handlePrototypedArrayNode(PrototypedArrayNode $node, ClassBuild */ public function NAME($value): self { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY = $value; return $this; @@ -200,6 +234,7 @@ public function NAME($value): self */ public function NAME(string $VAR, $VALUE): self { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY[$VAR] = $VALUE; return $this; @@ -217,27 +252,69 @@ public function NAME(string $VAR, $VALUE): self } $class->addRequire($childClass); $this->classes[] = $childClass; - $property = $class->addProperty($node->getName(), $childClass->getFqcn().'[]'); + + $hasNormalizationClosures = $this->hasNormalizationClosures($node) || $this->hasNormalizationClosures($prototype); + $property = $class->addProperty( + $node->getName(), + $this->getType($childClass->getFqcn().'[]', $hasNormalizationClosures) + ); if (null === $key = $node->getKeyAttribute()) { - $body = ' + $body = $hasNormalizationClosures ? ' +/** + * @return CLASS|$this + */ +public function NAME($value = []) +{ + $this->_usedProperties[\'PROPERTY\'] = true; + if (!\is_array($value)) { + $this->PROPERTY[] = $value; + + return $this; + } + + return $this->PROPERTY[] = new CLASS($value); +}' : ' public function NAME(array $value = []): CLASS { + $this->_usedProperties[\'PROPERTY\'] = true; + return $this->PROPERTY[] = new CLASS($value); }'; $class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn()]); } else { - $body = ' + $body = $hasNormalizationClosures ? ' +/** + * @return CLASS|$this + */ +public function NAME(string $VAR, $VALUE = []) +{ + if (!\is_array($VALUE)) { + $this->_usedProperties[\'PROPERTY\'] = true; + $this->PROPERTY[$VAR] = $VALUE; + + return $this; + } + + if (!isset($this->PROPERTY[$VAR]) || !$this->PROPERTY[$VAR] instanceof CLASS) { + $this->_usedProperties[\'PROPERTY\'] = true; + $this->PROPERTY[$VAR] = new CLASS($VALUE); + } elseif (1 < \func_num_args()) { + throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'); + } + + return $this->PROPERTY[$VAR]; +}' : ' public function NAME(string $VAR, array $VALUE = []): CLASS { if (!isset($this->PROPERTY[$VAR])) { - return $this->PROPERTY[$VAR] = new CLASS($value); - } - if ([] === $value) { - return $this->PROPERTY[$VAR]; + $this->_usedProperties[\'PROPERTY\'] = true; + $this->PROPERTY[$VAR] = new CLASS($VALUE); + } elseif (1 < \func_num_args()) { + throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'); } - throw new InvalidConfigurationException(\'The node created by "NAME()" has already been initialized. You cannot pass values the second time you call NAME().\'); + return $this->PROPERTY[$VAR]; }'; $class->addUse(InvalidConfigurationException::class); $class->addMethod($methodName, $body, ['PROPERTY' => $property->getName(), 'CLASS' => $childClass->getFqcn(), 'VAR' => '' === $key ? 'key' : $key, 'VALUE' => 'value' === $key ? 'data' : 'value']); @@ -258,6 +335,7 @@ private function handleScalarNode(ScalarNode $node, ClassBuilder $class): void */ public function NAME($value): self { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY = $value; return $this; @@ -360,16 +438,22 @@ private function buildToArray(ClassBuilder $class): void $code = '$this->PROPERTY'; if (null !== $p->getType()) { if ($p->isArray()) { - $code = 'array_map(function ($v) { return $v->toArray(); }, $this->PROPERTY)'; + $code = $p->areScalarsAllowed() + ? 'array_map(function ($v) { return $v instanceof CLASS ? $v->toArray() : $v; }, $this->PROPERTY)' + : 'array_map(function ($v) { return $v->toArray(); }, $this->PROPERTY)' + ; } else { - $code = '$this->PROPERTY->toArray()'; + $code = $p->areScalarsAllowed() + ? '$this->PROPERTY instanceof CLASS ? $this->PROPERTY->toArray() : $this->PROPERTY' + : '$this->PROPERTY->toArray()' + ; } } $body .= strtr(' - if (null !== $this->PROPERTY) { + if (isset($this->_usedProperties[\'PROPERTY\'])) { $output[\'ORG_NAME\'] = '.$code.'; - }', ['PROPERTY' => $p->getName(), 'ORG_NAME' => $p->getOriginalName()]); + }', ['PROPERTY' => $p->getName(), 'ORG_NAME' => $p->getOriginalName(), 'CLASS' => $p->getType()]); } $extraKeys = $class->shouldAllowExtraKeys() ? ' + $this->_extraKeys' : ''; @@ -390,14 +474,21 @@ private function buildConstructor(ClassBuilder $class): void $code = '$value[\'ORG_NAME\']'; if (null !== $p->getType()) { if ($p->isArray()) { - $code = 'array_map(function ($v) { return new '.$p->getType().'($v); }, $value[\'ORG_NAME\'])'; + $code = $p->areScalarsAllowed() + ? 'array_map(function ($v) { return \is_array($v) ? new '.$p->getType().'($v) : $v; }, $value[\'ORG_NAME\'])' + : 'array_map(function ($v) { return new '.$p->getType().'($v); }, $value[\'ORG_NAME\'])' + ; } else { - $code = 'new '.$p->getType().'($value[\'ORG_NAME\'])'; + $code = $p->areScalarsAllowed() + ? '\is_array($value[\'ORG_NAME\']) ? new '.$p->getType().'($value[\'ORG_NAME\']) : $value[\'ORG_NAME\']' + : 'new '.$p->getType().'($value[\'ORG_NAME\'])' + ; } } $body .= strtr(' - if (isset($value[\'ORG_NAME\'])) { + if (array_key_exists(\'ORG_NAME\', $value)) { + $this->_usedProperties[\'PROPERTY\'] = true; $this->PROPERTY = '.$code.'; unset($value[\'ORG_NAME\']); } @@ -419,8 +510,7 @@ private function buildConstructor(ClassBuilder $class): void $class->addMethod('__construct', ' public function __construct(array $value = []) -{ -'.$body.' +{'.$body.' }'); } @@ -441,11 +531,7 @@ private function buildSetExtraKey(ClassBuilder $class): void */ public function NAME(string $key, $value): self { - if (null === $value) { - unset($this->_extraKeys[$key]); - } else { - $this->_extraKeys[$key] = $value; - } + $this->_extraKeys[$key] = $value; return $this; }'); @@ -455,4 +541,21 @@ private function getSubNamespace(ClassBuilder $rootClass): string { return sprintf('%s\\%s', $rootClass->getNamespace(), substr($rootClass->getName(), 0, -6)); } + + private function hasNormalizationClosures(NodeInterface $node): bool + { + try { + $r = new \ReflectionProperty($node, 'normalizationClosures'); + } catch (\ReflectionException $e) { + return false; + } + $r->setAccessible(true); + + return [] !== $r->getValue($node); + } + + private function getType(string $classType, bool $hasNormalizationClosures): string + { + return $classType.($hasNormalizationClosures ? '|scalar' : ''); + } } diff --git a/tests/integration/vendor/symfony/config/Builder/Property.php b/tests/integration/vendor/symfony/config/Builder/Property.php index 1b24c47cc..5a6f7e31b 100644 --- a/tests/integration/vendor/symfony/config/Builder/Property.php +++ b/tests/integration/vendor/symfony/config/Builder/Property.php @@ -23,6 +23,7 @@ class Property private $name; private $originalName; private $array = false; + private $scalarsAllowed = false; private $type = null; private $content; @@ -47,6 +48,11 @@ public function setType(string $type): void $this->array = false; $this->type = $type; + if ('|scalar' === substr($type, -7)) { + $this->scalarsAllowed = true; + $this->type = $type = substr($type, 0, -7); + } + if ('[]' === substr($type, -2)) { $this->array = true; $this->type = substr($type, 0, -2); @@ -72,4 +78,9 @@ public function isArray(): bool { return $this->array; } + + public function areScalarsAllowed(): bool + { + return $this->scalarsAllowed; + } } diff --git a/tests/integration/vendor/symfony/config/Definition/BaseNode.php b/tests/integration/vendor/symfony/config/Definition/BaseNode.php index 5ca123925..673cfaf60 100644 --- a/tests/integration/vendor/symfony/config/Definition/BaseNode.php +++ b/tests/integration/vendor/symfony/config/Definition/BaseNode.php @@ -203,7 +203,7 @@ public function setRequired(bool $boolean) * You can use %node% and %path% placeholders in your message to display, * respectively, the node name and its complete path */ - public function setDeprecated(?string $package/*, string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.' */) + public function setDeprecated(?string $package/* , string $version, string $message = 'The child node "%node%" at path "%path%" is deprecated.' */) { $args = \func_get_args(); diff --git a/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php b/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php index a8b18a023..4979ae96c 100644 --- a/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php +++ b/tests/integration/vendor/symfony/config/Definition/Dumper/XmlReferenceDumper.php @@ -147,7 +147,7 @@ private function writeNode(NodeInterface $node, int $depth = 0, bool $root = fal } if ($child instanceof BaseNode && $example = $child->getExample()) { - $comments[] = 'Example: '.$example; + $comments[] = 'Example: '.(\is_array($example) ? implode(', ', $example) : $example); } if ($child->isRequired()) { diff --git a/tests/integration/vendor/symfony/config/Definition/Processor.php b/tests/integration/vendor/symfony/config/Definition/Processor.php index c431408e1..312783f55 100644 --- a/tests/integration/vendor/symfony/config/Definition/Processor.php +++ b/tests/integration/vendor/symfony/config/Definition/Processor.php @@ -63,9 +63,9 @@ public function processConfiguration(ConfigurationInterface $configuration, arra * * extensions: ['twig.extension.foo', 'twig.extension.bar'] * - * @param array $config A config array - * @param string $key The key to normalize - * @param string $plural The plural form of the key if it is irregular + * @param array $config A config array + * @param string $key The key to normalize + * @param string|null $plural The plural form of the key if it is irregular */ public static function normalizeConfig(array $config, string $key, string $plural = null): array { diff --git a/tests/integration/vendor/symfony/config/Definition/ScalarNode.php b/tests/integration/vendor/symfony/config/Definition/ScalarNode.php index 5296c2796..89ed4c3dc 100644 --- a/tests/integration/vendor/symfony/config/Definition/ScalarNode.php +++ b/tests/integration/vendor/symfony/config/Definition/ScalarNode.php @@ -32,7 +32,7 @@ class ScalarNode extends VariableNode */ protected function validateType($value) { - if (!is_scalar($value) && null !== $value) { + if (!\is_scalar($value) && null !== $value) { $ex = new InvalidTypeException(sprintf('Invalid type for path "%s". Expected "scalar", but got "%s".', $this->getPath(), get_debug_type($value))); if ($hint = $this->getInfo()) { $ex->addHint($hint); diff --git a/tests/integration/vendor/symfony/config/LICENSE b/tests/integration/vendor/symfony/config/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/config/LICENSE +++ b/tests/integration/vendor/symfony/config/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/config/Resource/ClassExistenceResource.php b/tests/integration/vendor/symfony/config/Resource/ClassExistenceResource.php index 6aff151cc..661603692 100644 --- a/tests/integration/vendor/symfony/config/Resource/ClassExistenceResource.php +++ b/tests/integration/vendor/symfony/config/Resource/ClassExistenceResource.php @@ -32,7 +32,7 @@ class ClassExistenceResource implements SelfCheckingResourceInterface /** * @param string $resource The fully-qualified class name - * @param bool|null $exists Boolean when the existency check has already been done + * @param bool|null $exists Boolean when the existence check has already been done */ public function __construct(string $resource, bool $exists = null) { diff --git a/tests/integration/vendor/symfony/config/Resource/GlobResource.php b/tests/integration/vendor/symfony/config/Resource/GlobResource.php index 093f55916..2bfbe2e4b 100644 --- a/tests/integration/vendor/symfony/config/Resource/GlobResource.php +++ b/tests/integration/vendor/symfony/config/Resource/GlobResource.php @@ -109,7 +109,9 @@ public function getIterator(): \Traversable $prefix = str_replace('\\', '/', $this->prefix); $paths = null; - if (!str_starts_with($this->prefix, 'phar://') && !str_contains($this->pattern, '/**/')) { + if ('' === $this->pattern && is_file($prefix)) { + $paths = [$this->prefix]; + } elseif (!str_starts_with($this->prefix, 'phar://') && !str_contains($this->pattern, '/**/')) { if ($this->globBrace || !str_contains($this->pattern, '{')) { $paths = glob($this->prefix.$this->pattern, \GLOB_NOSORT | $this->globBrace); } elseif (!str_contains($this->pattern, '\\') || !preg_match('/\\\\[,{}]/', $this->pattern)) { @@ -170,14 +172,21 @@ function (\SplFileInfo $file, $path) { throw new \LogicException(sprintf('Extended glob pattern "%s" cannot be used as the Finder component is not installed.', $this->pattern)); } + if (is_file($prefix = $this->prefix)) { + $prefix = \dirname($prefix); + $pattern = basename($prefix).$this->pattern; + } else { + $pattern = $this->pattern; + } + $finder = new Finder(); - $regex = Glob::toRegex($this->pattern); + $regex = Glob::toRegex($pattern); if ($this->recursive) { $regex = substr_replace($regex, '(/|$)', -2, 1); } - $prefixLen = \strlen($this->prefix); - foreach ($finder->followLinks()->sortByName()->in($this->prefix) as $path => $info) { + $prefixLen = \strlen($prefix); + foreach ($finder->followLinks()->sortByName()->in($prefix) as $path => $info) { $normalizedPath = str_replace('\\', '/', $path); if (!preg_match($regex, substr($normalizedPath, $prefixLen)) || !$info->isFile()) { continue; diff --git a/tests/integration/vendor/symfony/config/ResourceCheckerConfigCache.php b/tests/integration/vendor/symfony/config/ResourceCheckerConfigCache.php index a0d301c1f..ba0e180c5 100644 --- a/tests/integration/vendor/symfony/config/ResourceCheckerConfigCache.php +++ b/tests/integration/vendor/symfony/config/ResourceCheckerConfigCache.php @@ -136,7 +136,7 @@ public function write(string $content, array $metadata = null) } } - if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { + if (\function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN)) { @opcache_invalidate($this->file, true); } } diff --git a/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php b/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php index a335bbd2e..155571cec 100644 --- a/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php +++ b/tests/integration/vendor/symfony/config/Util/Exception/InvalidXmlException.php @@ -1,4 +1,5 @@ getCode(); if (is_numeric($exitCode)) { $exitCode = (int) $exitCode; - if (0 === $exitCode) { + if ($exitCode <= 0) { $exitCode = 1; } } else { @@ -276,7 +276,9 @@ public function doRun(InputInterface $input, OutputInterface $output) $alternative = $alternatives[0]; $style = new SymfonyStyle($input, $output); - $style->block(sprintf("\nCommand \"%s\" is not defined.\n", $name), null, 'error'); + $output->writeln(''); + $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); + $output->writeln($formattedBlock); if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { if (null !== $this->dispatcher) { $event = new ConsoleErrorEvent($input, $output, $e); @@ -363,9 +365,18 @@ public function complete(CompletionInput $input, CompletionSuggestions $suggesti CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() && 'command' === $input->getCompletionName() ) { - $suggestions->suggestValues(array_filter(array_map(function (Command $command) { - return $command->isHidden() ? null : $command->getName(); - }, $this->all()))); + $commandNames = []; + foreach ($this->all() as $name => $command) { + // skip hidden commands and aliased commands as they already get added below + if ($command->isHidden() || $command->getName() !== $name) { + continue; + } + $commandNames[] = $command->getName(); + foreach ($command->getAliases() as $name) { + $commandNames[] = $name; + } + } + $suggestions->suggestValues(array_filter($commandNames)); return; } @@ -924,11 +935,21 @@ protected function configureIO(InputInterface $input, OutputInterface $output) } switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); break; - case 1: $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); break; - case 2: $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); break; - case 3: $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); break; - default: $shellVerbosity = 0; break; + case -1: + $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); + break; + case 1: + $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); + break; + case 2: + $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); + break; + case 3: + $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); + break; + default: + $shellVerbosity = 0; + break; } if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { @@ -974,22 +995,26 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - if ($command instanceof SignalableCommandInterface && ($this->signalsToDispatchEvent || $command->getSubscribedSignals())) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } + if ($this->signalsToDispatchEvent) { + $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; + + if ($commandSignals || null !== $this->dispatcher) { + if (!$this->signalRegistry) { + throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); + } - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); + if (Terminal::hasSttyAvailable()) { + $sttyMode = shell_exec('stty -g'); - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); + foreach ([\SIGINT, \SIGTERM] as $signal) { + $this->signalRegistry->register($signal, static function () use ($sttyMode) { + shell_exec('stty '.$sttyMode); + }); + } } } - if ($this->dispatcher) { + if (null !== $this->dispatcher) { foreach ($this->signalsToDispatchEvent as $signal) { $event = new ConsoleSignalEvent($command, $input, $output, $signal); @@ -1006,7 +1031,7 @@ protected function doRunCommand(Command $command, InputInterface $input, OutputI } } - foreach ($command->getSubscribedSignals() as $signal) { + foreach ($commandSignals as $signal) { $this->signalRegistry->register($signal, [$command, 'handleSignal']); } } diff --git a/tests/integration/vendor/symfony/console/Command/Command.php b/tests/integration/vendor/symfony/console/Command/Command.php index 146f6017b..cfa18361e 100644 --- a/tests/integration/vendor/symfony/console/Command/Command.php +++ b/tests/integration/vendor/symfony/console/Command/Command.php @@ -242,7 +242,7 @@ protected function initialize(InputInterface $input, OutputInterface $output) * * @return int The command exit code * - * @throws \Exception When binding input fails. Bypass this by calling {@link ignoreValidationErrors()}. + * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. * * @see setCode() * @see execute() @@ -429,9 +429,9 @@ public function getNativeDefinition() * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) * - * @throws InvalidArgumentException When argument mode is not valid - * * @return $this + * + * @throws InvalidArgumentException When argument mode is not valid */ public function addArgument(string $name, int $mode = null, string $description = '', $default = null) { @@ -450,9 +450,9 @@ public function addArgument(string $name, int $mode = null, string $description * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) * - * @throws InvalidArgumentException If option mode is invalid or incompatible - * * @return $this + * + * @throws InvalidArgumentException If option mode is invalid or incompatible */ public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) { @@ -518,7 +518,7 @@ public function getName() * * @final since Symfony 5.1 */ - public function setHidden(bool $hidden /*= true*/) + public function setHidden(bool $hidden /* = true */) { $this->hidden = $hidden; diff --git a/tests/integration/vendor/symfony/console/Command/CompleteCommand.php b/tests/integration/vendor/symfony/console/Command/CompleteCommand.php index 97357d673..0e35143c3 100644 --- a/tests/integration/vendor/symfony/console/Command/CompleteCommand.php +++ b/tests/integration/vendor/symfony/console/Command/CompleteCommand.php @@ -65,15 +65,15 @@ protected function execute(InputInterface $input, OutputInterface $output): int { try { // uncomment when a bugfix or BC break has been introduced in the shell completion scripts - //$version = $input->getOption('symfony'); - //if ($version && version_compare($version, 'x.y', '>=')) { + // $version = $input->getOption('symfony'); + // if ($version && version_compare($version, 'x.y', '>=')) { // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version); // $this->log($message); // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); // return 126; - //} + // } $shell = $input->getOption('shell'); if (!$shell) { @@ -105,11 +105,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int } elseif ( $completionInput->mustSuggestArgumentValuesFor('command') && $command->getName() !== $completionInput->getCompletionValue() + && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) ) { $this->log(' No command found, completing using the Application class.'); // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValue($command->getName()); + $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); } else { $command->mergeApplicationDefinition(); $completionInput->bind($command->getDefinition()); @@ -154,10 +155,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int throw $e; } - return self::FAILURE; + return 2; } - return self::SUCCESS; + return 0; } private function createCompletionInput(InputInterface $input): CompletionInput diff --git a/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php b/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php index 64a800530..eaf22be1a 100644 --- a/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php +++ b/tests/integration/vendor/symfony/console/Command/DumpCompletionCommand.php @@ -41,7 +41,7 @@ protected function configure() { $fullCommand = $_SERVER['PHP_SELF']; $commandName = basename($fullCommand); - $fullCommand = realpath($fullCommand) ?: $fullCommand; + $fullCommand = @realpath($fullCommand) ?: $fullCommand; $this ->setHelp(<<%command.full_name% bash | sudo tee /etc/bash_completion.d/${commandName} + %command.full_name% bash | sudo tee /etc/bash_completion.d/{$commandName} Or dump the script to a local file and source it: @@ -70,7 +70,7 @@ protected function configure() Add this to the end of your shell configuration file (e.g. "~/.bashrc"): - eval "$(${fullCommand} completion bash)" + eval "$({$fullCommand} completion bash)" EOH ) ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given') @@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($input->getOption('debug')) { $this->tailDebugLog($commandName, $output); - return self::SUCCESS; + return 0; } $shell = $input->getArgument('shell') ?? self::guessShell(); @@ -93,15 +93,21 @@ protected function execute(InputInterface $input, OutputInterface $output): int if (!file_exists($completionFile)) { $supportedShells = $this->getSupportedShells(); - ($output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output) - ->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + if ($output instanceof ConsoleOutputInterface) { + $output = $output->getErrorOutput(); + } + if ($shell) { + $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); + } else { + $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); + } - return self::INVALID; + return 2; } $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); - return self::SUCCESS; + return 0; } private static function guessShell(): string @@ -126,8 +132,14 @@ private function tailDebugLog(string $commandName, OutputInterface $output): voi */ private function getSupportedShells(): array { - return array_map(function ($f) { - return pathinfo($f, \PATHINFO_EXTENSION); - }, glob(__DIR__.'/../Resources/completion.*')); + $shells = []; + + foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { + if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { + $shells[] = $file->getExtension(); + } + } + + return $shells; } } diff --git a/tests/integration/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/tests/integration/vendor/symfony/console/Completion/Output/BashCompletionOutput.php index 8d5ffa6b6..c6f76eb8f 100644 --- a/tests/integration/vendor/symfony/console/Completion/Output/BashCompletionOutput.php +++ b/tests/integration/vendor/symfony/console/Completion/Output/BashCompletionOutput.php @@ -24,6 +24,9 @@ public function write(CompletionSuggestions $suggestions, OutputInterface $outpu $values = $suggestions->getValueSuggestions(); foreach ($suggestions->getOptionSuggestions() as $option) { $values[] = '--'.$option->getName(); + if ($option->isNegatable()) { + $values[] = '--no-'.$option->getName(); + } } $output->writeln(implode("\n", $values)); } diff --git a/tests/integration/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/tests/integration/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php index 743e306d0..1fbb212e7 100644 --- a/tests/integration/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ b/tests/integration/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php @@ -67,7 +67,7 @@ public function process(ContainerBuilder $container) if (!$r->isSubclassOf(Command::class)) { throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } - $aliases = $class::getDefaultName(); + $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); } $aliases = explode('|', $aliases ?? ''); @@ -124,7 +124,7 @@ public function process(ContainerBuilder $container) if (!$r->isSubclassOf(Command::class)) { throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); } - $description = $class::getDefaultDescription(); + $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); } if ($description) { diff --git a/tests/integration/vendor/symfony/console/Descriptor/ApplicationDescription.php b/tests/integration/vendor/symfony/console/Descriptor/ApplicationDescription.php index fac01ad37..2a3acc99b 100644 --- a/tests/integration/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ b/tests/integration/vendor/symfony/console/Descriptor/ApplicationDescription.php @@ -131,7 +131,7 @@ private function sortCommands(array $commands): array } if ($namespacedCommands) { - ksort($namespacedCommands); + ksort($namespacedCommands, \SORT_STRING); foreach ($namespacedCommands as $key => $commandsSet) { ksort($commandsSet); $sortedCommands[$key] = $commandsSet; diff --git a/tests/integration/vendor/symfony/console/Exception/InvalidOptionException.php b/tests/integration/vendor/symfony/console/Exception/InvalidOptionException.php index b2eec6165..5cf62792e 100644 --- a/tests/integration/vendor/symfony/console/Exception/InvalidOptionException.php +++ b/tests/integration/vendor/symfony/console/Exception/InvalidOptionException.php @@ -12,7 +12,7 @@ namespace Symfony\Component\Console\Exception; /** - * Represents an incorrect option name typed in the console. + * Represents an incorrect option name or value typed in the console. * * @author Jérôme Tamarelle */ diff --git a/tests/integration/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/tests/integration/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php index bfd0afedd..9232510f4 100644 --- a/tests/integration/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ b/tests/integration/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php @@ -1,4 +1,5 @@ addLineBreaks($text, $width); $text = rtrim($text, "\n").($matches[1] ?? ''); if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { @@ -282,4 +284,11 @@ private function applyCurrentStyle(string $text, string $current, int $width, in return implode("\n", $lines); } + + private function addLineBreaks(string $text, int $width): string + { + $encoding = mb_detect_encoding($text, null, true) ?: 'UTF-8'; + + return b($text)->toCodePointString($encoding)->wordwrap($width, "\n", true)->toByteString($encoding); + } } diff --git a/tests/integration/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/tests/integration/vendor/symfony/console/Formatter/OutputFormatterStyle.php index 0fb36ac63..8370ba058 100644 --- a/tests/integration/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ b/tests/integration/vendor/symfony/console/Formatter/OutputFormatterStyle.php @@ -96,7 +96,8 @@ public function apply(string $text) { if (null === $this->handlesHrefGracefully) { $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100); + && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) + && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); } if (null !== $this->href && $this->handlesHrefGracefully) { diff --git a/tests/integration/vendor/symfony/console/Helper/Helper.php b/tests/integration/vendor/symfony/console/Helper/Helper.php index 50f51c790..c7d3e25d0 100644 --- a/tests/integration/vendor/symfony/console/Helper/Helper.php +++ b/tests/integration/vendor/symfony/console/Helper/Helper.php @@ -171,6 +171,8 @@ public static function removeDecoration(OutputFormatterInterface $formatter, ?st $string = $formatter->format($string ?? ''); // remove already formatted characters $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); + // remove terminal hyperlinks + $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); $formatter->setDecorated($isDecorated); return $string; diff --git a/tests/integration/vendor/symfony/console/Helper/ProgressBar.php b/tests/integration/vendor/symfony/console/Helper/ProgressBar.php index b1fb213b6..eb6aacb1a 100644 --- a/tests/integration/vendor/symfony/console/Helper/ProgressBar.php +++ b/tests/integration/vendor/symfony/console/Helper/ProgressBar.php @@ -53,7 +53,6 @@ final class ProgressBar private $startTime; private $stepWidth; private $percent = 0.0; - private $formatLineCount; private $messages = []; private $overwrite = true; private $terminal; @@ -446,8 +445,6 @@ private function setRealFormat(string $format) } else { $this->format = $format; } - - $this->formatLineCount = substr_count($this->format, "\n"); } /** @@ -464,7 +461,7 @@ private function overwrite(string $message): void if ($this->overwrite) { if (null !== $this->previousMessage) { if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $message); + $messageLines = explode("\n", $this->previousMessage); $lineCount = \count($messageLines); foreach ($messageLines as $messageLine) { $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); @@ -474,7 +471,8 @@ private function overwrite(string $message): void } $this->output->clear($lineCount); } else { - for ($i = 0; $i < $this->formatLineCount; ++$i) { + $lineCount = substr_count($this->previousMessage, "\n"); + for ($i = 0; $i < $lineCount; ++$i) { $this->cursor->moveToColumn(1); $this->cursor->clearLine(); $this->cursor->moveUp(); diff --git a/tests/integration/vendor/symfony/console/Helper/QuestionHelper.php b/tests/integration/vendor/symfony/console/Helper/QuestionHelper.php index 842a618ef..e236be92a 100644 --- a/tests/integration/vendor/symfony/console/Helper/QuestionHelper.php +++ b/tests/integration/vendor/symfony/console/Helper/QuestionHelper.php @@ -24,6 +24,7 @@ use Symfony\Component\Console\Question\ChoiceQuestion; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Terminal; + use function Symfony\Component\String\s; /** @@ -127,7 +128,18 @@ private function doAsk(OutputInterface $output, Question $question) } if (false === $ret) { + $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; + + if (!$isBlocked) { + stream_set_blocking($inputStream, true); + } + $ret = $this->readInput($inputStream, $question); + + if (!$isBlocked) { + stream_set_blocking($inputStream, false); + } + if (false === $ret) { throw new MissingInputException('Aborted.'); } @@ -499,13 +511,11 @@ private function isInteractiveInput($inputStream): bool return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); } - if (!\function_exists('exec')) { + if (!\function_exists('shell_exec')) { return self::$stdinIsInteractive = true; } - exec('stty 2> /dev/null', $output, $status); - - return self::$stdinIsInteractive = 1 !== $status; + return self::$stdinIsInteractive = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } /** diff --git a/tests/integration/vendor/symfony/console/Helper/Table.php b/tests/integration/vendor/symfony/console/Helper/Table.php index 6ade1360d..5c3447ab3 100644 --- a/tests/integration/vendor/symfony/console/Helper/Table.php +++ b/tests/integration/vendor/symfony/console/Helper/Table.php @@ -383,41 +383,59 @@ public function render() $this->calculateNumberOfColumns($rows); - $rows = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rows); + $rowGroups = $this->buildTableRows($rows); + $this->calculateColumnsWidth($rowGroups); $isHeader = !$this->horizontal; $isFirstRow = $this->horizontal; $hasTitle = (bool) $this->headerTitle; - foreach ($rows as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - continue; - } - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); + foreach ($rowGroups as $rowGroup) { + $isHeaderSeparatorRendered = false; - continue; - } - if (!$row) { - continue; - } + foreach ($rowGroup as $row) { + if ($divider === $row) { + $isHeader = false; + $isFirstRow = true; - if ($isHeader || $isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - if ($this->horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); + continue; + } + + if ($row instanceof TableSeparator) { + $this->renderRowSeparator(); + + continue; + } + + if (!$row) { + continue; + } + + if ($isHeader && !$isHeaderSeparatorRendered) { + $this->renderRowSeparator( + $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $hasTitle ? $this->headerTitle : null, + $hasTitle ? $this->style->getHeaderTitleFormat() : null + ); + $hasTitle = false; + $isHeaderSeparatorRendered = true; + } + + if ($isFirstRow) { + $this->renderRowSeparator( + $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, + $hasTitle ? $this->headerTitle : null, + $hasTitle ? $this->style->getHeaderTitleFormat() : null + ); + $isFirstRow = false; + $hasTitle = false; + } + + if ($this->horizontal) { + $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); + } else { + $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); + } } } $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); @@ -605,7 +623,7 @@ private function buildTableRows(array $rows): TableRows } $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell))); $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); + $lines = explode("\n", str_replace("\n", "\n", $cell)); foreach ($lines as $lineKey => $line) { if ($colspan > 1) { $line = new TableCell($line, ['colspan' => $colspan]); @@ -624,13 +642,14 @@ private function buildTableRows(array $rows): TableRows return new TableRows(function () use ($rows, $unmergedRows): \Traversable { foreach ($rows as $rowKey => $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); + $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; if (isset($unmergedRows[$rowKey])) { foreach ($unmergedRows[$rowKey] as $row) { - yield $row instanceof TableSeparator ? $row : $this->fillCells($row); + $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); } } + yield $rowGroup; } }); } @@ -659,7 +678,7 @@ private function fillNextRows(array $rows, int $line): array { $unmergedRows = []; foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { + if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); } if ($cell instanceof TableCell && $cell->getRowspan() > 1) { @@ -771,29 +790,31 @@ private function getRowColumns(array $row): array /** * Calculates columns widths. */ - private function calculateColumnsWidth(iterable $rows) + private function calculateColumnsWidth(iterable $groups) { for ($column = 0; $column < $this->numberOfColumns; ++$column) { $lengths = []; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } + foreach ($groups as $group) { + foreach ($group as $row) { + if ($row instanceof TableSeparator) { + continue; + } - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); - if ($textLength > 0) { - $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; + foreach ($row as $i => $cell) { + if ($cell instanceof TableCell) { + $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); + $textLength = Helper::width($textContent); + if ($textLength > 0) { + $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); + foreach ($contentColumns as $position => $content) { + $row[$i + $position] = $content; + } } } } - } - $lengths[] = $this->getCellWidth($row, $column); + $lengths[] = $this->getCellWidth($row, $column); + } } $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; @@ -844,9 +865,9 @@ private static function initStyles(): array $compact = new TableStyle(); $compact ->setHorizontalBorderChars('') - ->setVerticalBorderChars(' ') + ->setVerticalBorderChars('') ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s') + ->setCellRowContentFormat('%s ') ; $styleGuide = new TableStyle(); diff --git a/tests/integration/vendor/symfony/console/Input/InputArgument.php b/tests/integration/vendor/symfony/console/Input/InputArgument.php index e891b9443..8a64f7ac8 100644 --- a/tests/integration/vendor/symfony/console/Input/InputArgument.php +++ b/tests/integration/vendor/symfony/console/Input/InputArgument.php @@ -32,7 +32,7 @@ class InputArgument /** * @param string $name The argument name - * @param int|null $mode The argument mode: self::REQUIRED or self::OPTIONAL + * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY * @param string $description A description text * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) * @@ -92,7 +92,7 @@ public function isArray() */ public function setDefault($default = null) { - if (self::REQUIRED === $this->mode && null !== $default) { + if ($this->isRequired() && null !== $default) { throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); } diff --git a/tests/integration/vendor/symfony/console/LICENSE b/tests/integration/vendor/symfony/console/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/console/LICENSE +++ b/tests/integration/vendor/symfony/console/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/console/Logger/ConsoleLogger.php b/tests/integration/vendor/symfony/console/Logger/ConsoleLogger.php index c9ee03561..4a10fa172 100644 --- a/tests/integration/vendor/symfony/console/Logger/ConsoleLogger.php +++ b/tests/integration/vendor/symfony/console/Logger/ConsoleLogger.php @@ -110,7 +110,7 @@ private function interpolate(string $message, array $context): string $replacements = []; foreach ($context as $key => $val) { - if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { + if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { $replacements["{{$key}}"] = $val; } elseif ($val instanceof \DateTimeInterface) { $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); diff --git a/tests/integration/vendor/symfony/console/Resources/completion.bash b/tests/integration/vendor/symfony/console/Resources/completion.bash index c5e89c3c2..64b87ccf7 100644 --- a/tests/integration/vendor/symfony/console/Resources/completion.bash +++ b/tests/integration/vendor/symfony/console/Resources/completion.bash @@ -11,18 +11,21 @@ _sf_{{ COMMAND_NAME }}() { local sf_cmd="${COMP_WORDS[0]}" # for an alias, get the real script behind it - if [[ $(type -t $sf_cmd) == "alias" ]]; then + sf_cmd_type=$(type -t $sf_cmd) + if [[ $sf_cmd_type == "alias" ]]; then sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") + elif [[ $sf_cmd_type == "file" ]]; then + sf_cmd=$(type -p $sf_cmd) fi - if [ ! -f "$sf_cmd" ]; then + if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then return 1 fi local cur prev words cword _get_comp_words_by_ref -n := cur prev words cword - local completecmd=("$sf_cmd" "_complete" "-sbash" "-c$cword" "-S{{ VERSION }}") + local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}") for w in ${words[@]}; do w=$(printf -- '%b' "$w") # remove quotes from typed values diff --git a/tests/integration/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/tests/integration/vendor/symfony/console/SignalRegistry/SignalRegistry.php index ed93dd062..6bee24a42 100644 --- a/tests/integration/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ b/tests/integration/vendor/symfony/console/SignalRegistry/SignalRegistry.php @@ -43,7 +43,7 @@ public static function isSupported(): bool return false; } - if (\in_array('pcntl_signal', explode(',', ini_get('disable_functions')))) { + if (\in_array('pcntl_signal', explode(',', \ini_get('disable_functions')))) { return false; } diff --git a/tests/integration/vendor/symfony/console/Style/SymfonyStyle.php b/tests/integration/vendor/symfony/console/Style/SymfonyStyle.php index bcf30d80c..e3c5ac8e7 100644 --- a/tests/integration/vendor/symfony/console/Style/SymfonyStyle.php +++ b/tests/integration/vendor/symfony/console/Style/SymfonyStyle.php @@ -440,18 +440,18 @@ private function autoPrependBlock(): void $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); if (!isset($chars[0])) { - $this->newLine(); //empty history, so we should start with a new line. + $this->newLine(); // empty history, so we should start with a new line. return; } - //Prepend new line for each non LF chars (This means no blank line was output before) + // Prepend new line for each non LF chars (This means no blank line was output before) $this->newLine(2 - substr_count($chars, "\n")); } private function autoPrependText(): void { $fetched = $this->bufferedOutput->fetch(); - //Prepend new line if last char isn't EOL: + // Prepend new line if last char isn't EOL: if (!str_ends_with($fetched, "\n")) { $this->newLine(); } diff --git a/tests/integration/vendor/symfony/console/Terminal.php b/tests/integration/vendor/symfony/console/Terminal.php index 08c53535b..b91e8afc5 100644 --- a/tests/integration/vendor/symfony/console/Terminal.php +++ b/tests/integration/vendor/symfony/console/Terminal.php @@ -64,20 +64,19 @@ public static function hasSttyAvailable(): bool return self::$stty; } - // skip check if exec function is disabled - if (!\function_exists('exec')) { + // skip check if shell_exec function is disabled + if (!\function_exists('shell_exec')) { return false; } - exec('stty 2>&1', $output, $exitcode); - - return self::$stty = 0 === $exitcode; + return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); } private static function initDimensions() { if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { // extract [w, H] from "wxh (WxH)" // or [w, h] from "wxh" self::$width = (int) $matches[1]; @@ -157,6 +156,8 @@ private static function readFromProcess(string $command): ?string 2 => ['pipe', 'w'], ]; + $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; + $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); if (!\is_resource($process)) { return null; @@ -167,6 +168,10 @@ private static function readFromProcess(string $command): ?string fclose($pipes[2]); proc_close($process); + if ($cp) { + sapi_windows_cp_set($cp); + } + return $info; } } diff --git a/tests/integration/vendor/symfony/console/Tester/ApplicationTester.php b/tests/integration/vendor/symfony/console/Tester/ApplicationTester.php index 19a95c8e4..3a262e81c 100644 --- a/tests/integration/vendor/symfony/console/Tester/ApplicationTester.php +++ b/tests/integration/vendor/symfony/console/Tester/ApplicationTester.php @@ -49,17 +49,37 @@ public function __construct(Application $application) */ public function run(array $input, array $options = []) { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } + $prevShellVerbosity = getenv('SHELL_VERBOSITY'); - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } + try { + $this->input = new ArrayInput($input); + if (isset($options['interactive'])) { + $this->input->setInteractive($options['interactive']); + } - $this->initOutput($options); + if ($this->inputs) { + $this->input->setStream(self::createStream($this->inputs)); + } - return $this->statusCode = $this->application->run($this->input, $this->output); + $this->initOutput($options); + + return $this->statusCode = $this->application->run($this->input, $this->output); + } finally { + // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it + // to its previous value to avoid one test's verbosity to spread to the following tests + if (false === $prevShellVerbosity) { + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY'); + } + unset($_ENV['SHELL_VERBOSITY']); + unset($_SERVER['SHELL_VERBOSITY']); + } else { + if (\function_exists('putenv')) { + @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); + } + $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; + $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; + } + } } } diff --git a/tests/integration/vendor/symfony/console/Tester/TesterTrait.php b/tests/integration/vendor/symfony/console/Tester/TesterTrait.php index 40bc58177..f454bbf9d 100644 --- a/tests/integration/vendor/symfony/console/Tester/TesterTrait.php +++ b/tests/integration/vendor/symfony/console/Tester/TesterTrait.php @@ -35,9 +35,9 @@ trait TesterTrait /** * Gets the display returned by the last execution of the command or application. * - * @throws \RuntimeException If it's called before the execute method - * * @return string + * + * @throws \RuntimeException If it's called before the execute method */ public function getDisplay(bool $normalize = false) { @@ -103,9 +103,9 @@ public function getOutput() /** * Gets the status code returned by the last execution of the command or application. * - * @throws \RuntimeException If it's called before the execute method - * * @return int + * + * @throws \RuntimeException If it's called before the execute method */ public function getStatusCode() { diff --git a/tests/integration/vendor/symfony/console/composer.json b/tests/integration/vendor/symfony/console/composer.json index 9a565068c..4fa4964a1 100644 --- a/tests/integration/vendor/symfony/console/composer.json +++ b/tests/integration/vendor/symfony/console/composer.json @@ -2,7 +2,7 @@ "name": "symfony/console", "type": "library", "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command line", "terminal"], + "keywords": ["console", "cli", "command-line", "terminal"], "homepage": "https://symfony.com", "license": "MIT", "authors": [ diff --git a/tests/integration/vendor/symfony/deprecation-contracts/LICENSE b/tests/integration/vendor/symfony/deprecation-contracts/LICENSE index ad85e1737..406242ff2 100644 --- a/tests/integration/vendor/symfony/deprecation-contracts/LICENSE +++ b/tests/integration/vendor/symfony/deprecation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2021 Fabien Potencier +Copyright (c) 2020-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/event-dispatcher-contracts/LICENSE b/tests/integration/vendor/symfony/event-dispatcher-contracts/LICENSE index 235841453..74cdc2dbf 100644 --- a/tests/integration/vendor/symfony/event-dispatcher-contracts/LICENSE +++ b/tests/integration/vendor/symfony/event-dispatcher-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2021 Fabien Potencier +Copyright (c) 2018-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php b/tests/integration/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php index e1d2007fd..acfbf619c 100644 --- a/tests/integration/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php +++ b/tests/integration/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php @@ -75,7 +75,7 @@ public function removeListener(string $eventName, $listener) { if (isset($this->wrappedListeners[$eventName])) { foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener) { + if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { $listener = $wrappedListener; unset($this->wrappedListeners[$eventName][$index]); break; @@ -110,8 +110,8 @@ public function getListenerPriority(string $eventName, $listener) // we might have wrapped listeners for the event (if called while dispatching) // in that case get the priority by wrapper if (isset($this->wrappedListeners[$eventName])) { - foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) { - if ($wrappedListener->getWrappedListener() === $listener) { + foreach ($this->wrappedListeners[$eventName] as $wrappedListener) { + if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) { return $this->dispatcher->getListenerPriority($eventName, $wrappedListener); } } diff --git a/tests/integration/vendor/symfony/event-dispatcher/Debug/WrappedListener.php b/tests/integration/vendor/symfony/event-dispatcher/Debug/WrappedListener.php index 3916716ec..3c4cc1335 100644 --- a/tests/integration/vendor/symfony/event-dispatcher/Debug/WrappedListener.php +++ b/tests/integration/vendor/symfony/event-dispatcher/Debug/WrappedListener.php @@ -49,7 +49,7 @@ public function __construct($listener, ?string $name, Stopwatch $stopwatch, Even $r = new \ReflectionFunction($listener); if (str_contains($r->name, '{closure}')) { $this->pretty = $this->name = 'closure'; - } elseif ($class = $r->getClosureScopeClass()) { + } elseif ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { $this->name = $class->name; $this->pretty = $this->name.'::'.$r->name; } else { @@ -114,10 +114,12 @@ public function __invoke(object $event, string $eventName, EventDispatcherInterf $e = $this->stopwatch->start($this->name, 'event_listener'); - ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); - - if ($e->isStarted()) { - $e->stop(); + try { + ($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher); + } finally { + if ($e->isStarted()) { + $e->stop(); + } } if ($event instanceof StoppableEventInterface && $event->isPropagationStopped()) { diff --git a/tests/integration/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php b/tests/integration/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php index 8eabe7d74..5f44ff090 100644 --- a/tests/integration/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php +++ b/tests/integration/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php @@ -115,14 +115,18 @@ public function process(ContainerBuilder $container) ], function ($matches) { return strtoupper($matches[0]); }, $event['event']); $event['method'] = preg_replace('/[^a-z0-9]/i', '', $event['method']); - if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method']) && $r->hasMethod('__invoke')) { + if (null !== ($class = $container->getDefinition($id)->getClass()) && ($r = $container->getReflectionClass($class, false)) && !$r->hasMethod($event['method'])) { + if (!$r->hasMethod('__invoke')) { + throw new InvalidArgumentException(sprintf('None of the "%s" or "__invoke" methods exist for the service "%s". Please define the "method" attribute on "%s" tags.', $event['method'], $id, $this->listenerTag)); + } + $event['method'] = '__invoke'; } } $dispatcherDefinition = $globalDispatcherDefinition; if (isset($event['dispatcher'])) { - $dispatcherDefinition = $container->getDefinition($event['dispatcher']); + $dispatcherDefinition = $container->findDefinition($event['dispatcher']); } $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); @@ -161,7 +165,7 @@ public function process(ContainerBuilder $container) continue; } - $dispatcherDefinitions[$attributes['dispatcher']] = $container->getDefinition($attributes['dispatcher']); + $dispatcherDefinitions[$attributes['dispatcher']] = $container->findDefinition($attributes['dispatcher']); } if (!$dispatcherDefinitions) { diff --git a/tests/integration/vendor/symfony/event-dispatcher/EventDispatcher.php b/tests/integration/vendor/symfony/event-dispatcher/EventDispatcher.php index c479a7544..8fe8fb5c2 100644 --- a/tests/integration/vendor/symfony/event-dispatcher/EventDispatcher.php +++ b/tests/integration/vendor/symfony/event-dispatcher/EventDispatcher.php @@ -108,7 +108,7 @@ public function getListenerPriority(string $eventName, $listener) $v[0] = $v[0](); $v[1] = $v[1] ?? '__invoke'; } - if ($v === $listener) { + if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { return $priority; } } @@ -164,7 +164,7 @@ public function removeListener(string $eventName, $listener) $v[0] = $v[0](); $v[1] = $v[1] ?? '__invoke'; } - if ($v === $listener) { + if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) { unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]); } } diff --git a/tests/integration/vendor/symfony/event-dispatcher/LICENSE b/tests/integration/vendor/symfony/event-dispatcher/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/event-dispatcher/LICENSE +++ b/tests/integration/vendor/symfony/event-dispatcher/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/filesystem/Filesystem.php b/tests/integration/vendor/symfony/filesystem/Filesystem.php index 524d17c2b..23192bc74 100644 --- a/tests/integration/vendor/symfony/filesystem/Filesystem.php +++ b/tests/integration/vendor/symfony/filesystem/Filesystem.php @@ -170,7 +170,7 @@ private static function doRemove(array $files, bool $isRecursive): void } } elseif (is_dir($file)) { if (!$isRecursive) { - $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-.')); + $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_')); if (file_exists($tmpName)) { try { @@ -329,6 +329,8 @@ private function isReadable(string $filename): bool */ public function symlink(string $originDir, string $targetDir, bool $copyOnWindows = false) { + self::assertFunctionExists('symlink'); + if ('\\' === \DIRECTORY_SEPARATOR) { $originDir = strtr($originDir, '/', '\\'); $targetDir = strtr($targetDir, '/', '\\'); @@ -364,6 +366,8 @@ public function symlink(string $originDir, string $targetDir, bool $copyOnWindow */ public function hardlink(string $originFile, $targetFiles) { + self::assertFunctionExists('link'); + if (!$this->exists($originFile)) { throw new FileNotFoundException(null, 0, null, $originFile); } @@ -611,7 +615,7 @@ public function isAbsolutePath(string $file) * * @return string The new temporary filename (with path), or throw an exception on failure */ - public function tempnam(string $dir, string $prefix/*, string $suffix = ''*/) + public function tempnam(string $dir, string $prefix/* , string $suffix = '' */) { $suffix = \func_num_args() > 2 ? func_get_arg(2) : ''; [$scheme, $hierarchy] = $this->getSchemeAndHierarchy($dir); @@ -665,6 +669,12 @@ public function dumpFile(string $filename, $content) $dir = \dirname($filename); + if (is_link($filename) && $linkTarget = $this->readlink($filename)) { + $this->dumpFile(Path::makeAbsolute($linkTarget, $dir), $content); + + return; + } + if (!is_dir($dir)) { $this->mkdir($dir); } @@ -696,7 +706,7 @@ public function dumpFile(string $filename, $content) * * @throws IOException If the file is not writable */ - public function appendToFile(string $filename, $content/*, bool $lock = false*/) + public function appendToFile(string $filename, $content/* , bool $lock = false */) { if (\is_array($content)) { throw new \TypeError(sprintf('Argument 2 passed to "%s()" must be string or resource, array given.', __METHOD__)); @@ -730,13 +740,22 @@ private function getSchemeAndHierarchy(string $filename): array return 2 === \count($components) ? [$components[0], $components[1]] : [null, $components[0]]; } + private static function assertFunctionExists(string $func): void + { + if (!\function_exists($func)) { + throw new IOException(sprintf('Unable to perform filesystem operation because the "%s()" function has been disabled.', $func)); + } + } + /** * @param mixed ...$args * * @return mixed */ - private static function box(callable $func, ...$args) + private static function box(string $func, ...$args) { + self::assertFunctionExists($func); + self::$lastError = null; set_error_handler(__CLASS__.'::handleError'); try { diff --git a/tests/integration/vendor/symfony/filesystem/LICENSE b/tests/integration/vendor/symfony/filesystem/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/filesystem/LICENSE +++ b/tests/integration/vendor/symfony/filesystem/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/filesystem/Path.php b/tests/integration/vendor/symfony/filesystem/Path.php index 6ccb2e99a..9aa37355a 100644 --- a/tests/integration/vendor/symfony/filesystem/Path.php +++ b/tests/integration/vendor/symfony/filesystem/Path.php @@ -81,7 +81,7 @@ public static function canonicalize(string $path): string // Replace "~" with user's home directory. if ('~' === $path[0]) { - $path = self::getHomeDirectory().mb_substr($path, 1); + $path = self::getHomeDirectory().substr($path, 1); } $path = self::normalize($path); @@ -151,14 +151,14 @@ public static function getDirectory(string $path): string $path = self::canonicalize($path); // Maintain scheme - if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) { - $scheme = mb_substr($path, 0, $schemeSeparatorPosition + 3); - $path = mb_substr($path, $schemeSeparatorPosition + 3); + if (false !== $schemeSeparatorPosition = strpos($path, '://')) { + $scheme = substr($path, 0, $schemeSeparatorPosition + 3); + $path = substr($path, $schemeSeparatorPosition + 3); } else { $scheme = ''; } - if (false === ($dirSeparatorPosition = strrpos($path, '/'))) { + if (false === $dirSeparatorPosition = strrpos($path, '/')) { return ''; } @@ -169,10 +169,10 @@ public static function getDirectory(string $path): string // Directory equals Windows root "C:/" if (2 === $dirSeparatorPosition && ctype_alpha($path[0]) && ':' === $path[1]) { - return $scheme.mb_substr($path, 0, 3); + return $scheme.substr($path, 0, 3); } - return $scheme.mb_substr($path, 0, $dirSeparatorPosition); + return $scheme.substr($path, 0, $dirSeparatorPosition); } /** @@ -219,7 +219,7 @@ public static function getRoot(string $path): string } // Maintain scheme - if (false !== ($schemeSeparatorPosition = strpos($path, '://'))) { + if (false !== $schemeSeparatorPosition = strpos($path, '://')) { $scheme = substr($path, 0, $schemeSeparatorPosition + 3); $path = substr($path, $schemeSeparatorPosition + 3); } else { @@ -233,7 +233,7 @@ public static function getRoot(string $path): string return $scheme.'/'; } - $length = mb_strlen($path); + $length = \strlen($path); // Windows root if ($length > 1 && ':' === $path[1] && ctype_alpha($firstCharacter)) { @@ -257,7 +257,7 @@ public static function getRoot(string $path): string * @param string|null $extension if specified, only that extension is cut * off (may contain leading dot) */ - public static function getFilenameWithoutExtension(string $path, string $extension = null) + public static function getFilenameWithoutExtension(string $path, string $extension = null): string { if ('' === $path) { return ''; @@ -349,16 +349,16 @@ public static function changeExtension(string $path, string $extension): string $extension = ltrim($extension, '.'); // No extension for paths - if ('/' === mb_substr($path, -1)) { + if ('/' === substr($path, -1)) { return $path; } // No actual extension in path if (empty($actualExtension)) { - return $path.('.' === mb_substr($path, -1) ? '' : '.').$extension; + return $path.('.' === substr($path, -1) ? '' : '.').$extension; } - return mb_substr($path, 0, -mb_strlen($actualExtension)).$extension; + return substr($path, 0, -\strlen($actualExtension)).$extension; } public static function isAbsolute(string $path): bool @@ -368,8 +368,8 @@ public static function isAbsolute(string $path): bool } // Strip scheme - if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) { - $path = mb_substr($path, $schemeSeparatorPosition + 3); + if (false !== $schemeSeparatorPosition = strpos($path, '://')) { + $path = substr($path, $schemeSeparatorPosition + 3); } $firstCharacter = $path[0]; @@ -380,9 +380,9 @@ public static function isAbsolute(string $path): bool } // Windows root - if (mb_strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) { + if (\strlen($path) > 1 && ctype_alpha($firstCharacter) && ':' === $path[1]) { // Special case: "C:" - if (2 === mb_strlen($path)) { + if (2 === \strlen($path)) { return true; } @@ -451,9 +451,9 @@ public static function makeAbsolute(string $path, string $basePath): string return self::canonicalize($path); } - if (false !== ($schemeSeparatorPosition = mb_strpos($basePath, '://'))) { - $scheme = mb_substr($basePath, 0, $schemeSeparatorPosition + 3); - $basePath = mb_substr($basePath, $schemeSeparatorPosition + 3); + if (false !== $schemeSeparatorPosition = strpos($basePath, '://')) { + $scheme = substr($basePath, 0, $schemeSeparatorPosition + 3); + $basePath = substr($basePath, $schemeSeparatorPosition + 3); } else { $scheme = ''; } @@ -574,7 +574,7 @@ public static function makeRelative(string $path, string $basePath): string */ public static function isLocal(string $path): bool { - return '' !== $path && false === mb_strpos($path, '://'); + return '' !== $path && false === strpos($path, '://'); } /** @@ -638,7 +638,7 @@ public static function getLongestCommonBasePath(string ...$paths): ?string // Prevent false positives for common prefixes // see isBasePath() - if (0 === mb_strpos($path.'/', $basePath.'/')) { + if (0 === strpos($path.'/', $basePath.'/')) { // next path continue 2; } @@ -666,12 +666,12 @@ public static function join(string ...$paths): string if (null === $finalPath) { // For first part we keep slashes, like '/top', 'C:\' or 'phar://' $finalPath = $path; - $wasScheme = (false !== mb_strpos($path, '://')); + $wasScheme = (false !== strpos($path, '://')); continue; } // Only add slash if previous part didn't end with '/' or '\' - if (!\in_array(mb_substr($finalPath, -1), ['/', '\\'])) { + if (!\in_array(substr($finalPath, -1), ['/', '\\'])) { $finalPath .= '/'; } @@ -717,11 +717,11 @@ public static function isBasePath(string $basePath, string $ofPath): bool // Don't append a slash for the root "/", because then that root // won't be discovered as common prefix ("//" is not a prefix of // "/foobar/"). - return 0 === mb_strpos($ofPath.'/', rtrim($basePath, '/').'/'); + return 0 === strpos($ofPath.'/', rtrim($basePath, '/').'/'); } /** - * @return non-empty-string[] + * @return string[] */ private static function findCanonicalParts(string $root, string $pathWithoutRoot): array { @@ -776,19 +776,19 @@ private static function split(string $path): array } // Remember scheme as part of the root, if any - if (false !== ($schemeSeparatorPosition = mb_strpos($path, '://'))) { - $root = mb_substr($path, 0, $schemeSeparatorPosition + 3); - $path = mb_substr($path, $schemeSeparatorPosition + 3); + if (false !== $schemeSeparatorPosition = strpos($path, '://')) { + $root = substr($path, 0, $schemeSeparatorPosition + 3); + $path = substr($path, $schemeSeparatorPosition + 3); } else { $root = ''; } - $length = mb_strlen($path); + $length = \strlen($path); // Remove and remember root directory - if (0 === mb_strpos($path, '/')) { + if (0 === strpos($path, '/')) { $root .= '/'; - $path = $length > 1 ? mb_substr($path, 1) : ''; + $path = $length > 1 ? substr($path, 1) : ''; } elseif ($length > 1 && ctype_alpha($path[0]) && ':' === $path[1]) { if (2 === $length) { // Windows special case: "C:" @@ -796,8 +796,8 @@ private static function split(string $path): array $path = ''; } elseif ('/' === $path[2]) { // Windows normal case: "C:/".. - $root .= mb_substr($path, 0, 3); - $path = $length > 3 ? mb_substr($path, 3) : ''; + $root .= substr($path, 0, 3); + $path = $length > 3 ? substr($path, 3) : ''; } } @@ -806,11 +806,11 @@ private static function split(string $path): array private static function toLower(string $string): string { - if (false !== $encoding = mb_detect_encoding($string)) { + if (false !== $encoding = mb_detect_encoding($string, null, true)) { return mb_strtolower($string, $encoding); } - return strtolower($string, $encoding); + return strtolower($string); } private function __construct() diff --git a/tests/integration/vendor/symfony/polyfill-ctype/LICENSE b/tests/integration/vendor/symfony/polyfill-ctype/LICENSE index 3f853aaf3..7536caeae 100644 --- a/tests/integration/vendor/symfony/polyfill-ctype/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-ctype/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-ctype/README.md b/tests/integration/vendor/symfony/polyfill-ctype/README.md index 8add1ab00..b144d03c3 100644 --- a/tests/integration/vendor/symfony/polyfill-ctype/README.md +++ b/tests/integration/vendor/symfony/polyfill-ctype/README.md @@ -4,7 +4,7 @@ Symfony Polyfill / Ctype This component provides `ctype_*` functions to users who run php versions without the ctype extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-ctype/composer.json b/tests/integration/vendor/symfony/polyfill-ctype/composer.json index ccb8e5703..e5c978f15 100644 --- a/tests/integration/vendor/symfony/polyfill-ctype/composer.json +++ b/tests/integration/vendor/symfony/polyfill-ctype/composer.json @@ -31,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/tests/integration/vendor/symfony/polyfill-intl-grapheme/Grapheme.php index 6f7c0c78d..5373f1685 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ b/tests/integration/vendor/symfony/polyfill-intl-grapheme/Grapheme.php @@ -48,7 +48,7 @@ public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = \strlen($s) + $start; } - if (!is_scalar($s)) { + if (!\is_scalar($s)) { $hasError = false; set_error_handler(function () use (&$hasError) { $hasError = true; }); $next = substr($s, $start); diff --git a/tests/integration/vendor/symfony/polyfill-intl-grapheme/LICENSE b/tests/integration/vendor/symfony/polyfill-intl-grapheme/LICENSE index 4cd8bdd30..6e3afce69 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-intl-grapheme/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-intl-grapheme/README.md b/tests/integration/vendor/symfony/polyfill-intl-grapheme/README.md index 77523ea27..f55d92c5c 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-grapheme/README.md +++ b/tests/integration/vendor/symfony/polyfill-intl-grapheme/README.md @@ -23,7 +23,7 @@ This component provides a partial, native PHP implementation of the - [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-intl-grapheme/composer.json b/tests/integration/vendor/symfony/polyfill-intl-grapheme/composer.json index 02c98ee30..c00d4e9e4 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-grapheme/composer.json +++ b/tests/integration/vendor/symfony/polyfill-intl-grapheme/composer.json @@ -28,7 +28,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-intl-normalizer/LICENSE b/tests/integration/vendor/symfony/polyfill-intl-normalizer/LICENSE index 4cd8bdd30..6e3afce69 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-intl-normalizer/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/tests/integration/vendor/symfony/polyfill-intl-normalizer/Normalizer.php index 4443c2322..81704ab37 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ b/tests/integration/vendor/symfony/polyfill-intl-normalizer/Normalizer.php @@ -90,7 +90,7 @@ public static function normalize(string $s, int $form = self::FORM_C) self::$cC = self::getData('combiningClass'); } - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { + if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { mb_internal_encoding('8bit'); } diff --git a/tests/integration/vendor/symfony/polyfill-intl-normalizer/README.md b/tests/integration/vendor/symfony/polyfill-intl-normalizer/README.md index 15060c5f1..b9b762e85 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-normalizer/README.md +++ b/tests/integration/vendor/symfony/polyfill-intl-normalizer/README.md @@ -6,7 +6,7 @@ This component provides a fallback implementation for the by the [Intl](https://php.net/intl) extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-intl-normalizer/composer.json b/tests/integration/vendor/symfony/polyfill-intl-normalizer/composer.json index 393edf701..2c4de2c83 100644 --- a/tests/integration/vendor/symfony/polyfill-intl-normalizer/composer.json +++ b/tests/integration/vendor/symfony/polyfill-intl-normalizer/composer.json @@ -29,7 +29,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/LICENSE b/tests/integration/vendor/symfony/polyfill-mbstring/LICENSE index 4cd8bdd30..6e3afce69 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-mbstring/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2019 Fabien Potencier +Copyright (c) 2015-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/Mbstring.php b/tests/integration/vendor/symfony/polyfill-mbstring/Mbstring.php index b65c54a6b..2e0b96940 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/Mbstring.php +++ b/tests/integration/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -69,7 +69,7 @@ final class Mbstring { public const MB_CASE_FOLD = \PHP_INT_MAX; - private const CASE_FOLD = [ + private const SIMPLE_CASE_FOLD = [ ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], ]; @@ -80,7 +80,7 @@ final class Mbstring public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) { - if (\is_array($fromEncoding) || ($fromEncoding !== null && false !== strpos($fromEncoding, ','))) { + if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); } else { $fromEncoding = self::getEncoding($fromEncoding); @@ -102,7 +102,7 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null $fromEncoding = 'Windows-1252'; } if ('UTF-8' !== $fromEncoding) { - $s = \iconv($fromEncoding, 'UTF-8//IGNORE', $s); + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); } return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); @@ -113,7 +113,7 @@ public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null $fromEncoding = 'UTF-8'; } - return \iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); } public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) @@ -130,7 +130,7 @@ public static function mb_convert_variables($toEncoding, $fromEncoding, &...$var public static function mb_decode_mimeheader($s) { - return \iconv_mime_decode($s, 2, self::$internalEncoding); + return iconv_mime_decode($s, 2, self::$internalEncoding); } public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) @@ -140,7 +140,7 @@ public static function mb_encode_mimeheader($s, $charset = null, $transferEncodi public static function mb_decode_numericentity($s, $convmap, $encoding = null) { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -150,7 +150,7 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) return false; } - if (null !== $encoding && !is_scalar($encoding)) { + if (null !== $encoding && !\is_scalar($encoding)) { trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return ''; // Instead of null (cf. mb_encode_numericentity). @@ -166,10 +166,10 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } $cnt = floor(\count($convmap) / 4) * 4; @@ -195,12 +195,12 @@ public static function mb_decode_numericentity($s, $convmap, $encoding = null) return $s; } - return \iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding.'//IGNORE', $s); } public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) { - if (null !== $s && !is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -210,13 +210,13 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ return false; } - if (null !== $encoding && !is_scalar($encoding)) { + if (null !== $encoding && !\is_scalar($encoding)) { trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); return null; // Instead of '' (cf. mb_decode_numericentity). } - if (null !== $is_hex && !is_scalar($is_hex)) { + if (null !== $is_hex && !\is_scalar($is_hex)) { trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); return null; @@ -232,10 +232,10 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; @@ -265,7 +265,7 @@ public static function mb_encode_numericentity($s, $convmap, $encoding = null, $ return $result; } - return \iconv('UTF-8', $encoding.'//IGNORE', $result); + return iconv('UTF-8', $encoding.'//IGNORE', $result); } public static function mb_convert_case($s, $mode, $encoding = null) @@ -280,10 +280,10 @@ public static function mb_convert_case($s, $mode, $encoding = null) if ('UTF-8' === $encoding) { $encoding = null; if (!preg_match('//u', $s)) { - $s = @\iconv('UTF-8', 'UTF-8//IGNORE', $s); + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); } } else { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } if (\MB_CASE_TITLE == $mode) { @@ -301,7 +301,11 @@ public static function mb_convert_case($s, $mode, $encoding = null) $map = $upper; } else { if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); + static $caseFolding = null; + if (null === $caseFolding) { + $caseFolding = self::getData('caseFolding'); + } + $s = strtr($s, $caseFolding); } static $lower = null; @@ -343,7 +347,7 @@ public static function mb_convert_case($s, $mode, $encoding = null) return $s; } - return \iconv('UTF-8', $encoding.'//IGNORE', $s); + return iconv('UTF-8', $encoding.'//IGNORE', $s); } public static function mb_internal_encoding($encoding = null) @@ -354,7 +358,7 @@ public static function mb_internal_encoding($encoding = null) $normalizedEncoding = self::getEncoding($encoding); - if ('UTF-8' === $normalizedEncoding || false !== @\iconv($normalizedEncoding, $normalizedEncoding, ' ')) { + if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { self::$internalEncoding = $normalizedEncoding; return true; @@ -406,6 +410,12 @@ public static function mb_encoding_aliases($encoding) public static function mb_check_encoding($var = null, $encoding = null) { + if (PHP_VERSION_ID < 70200 && \is_array($var)) { + trigger_error('mb_check_encoding() expects parameter 1 to be string, array given', \E_USER_WARNING); + + return null; + } + if (null === $encoding) { if (null === $var) { return false; @@ -413,7 +423,21 @@ public static function mb_check_encoding($var = null, $encoding = null) $encoding = self::$internalEncoding; } - return self::mb_detect_encoding($var, [$encoding]) || false !== @\iconv($encoding, $encoding, $var); + if (!\is_array($var)) { + return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); + } + + foreach ($var as $key => $value) { + if (!self::mb_check_encoding($key, $encoding)) { + return false; + } + if (!self::mb_check_encoding($value, $encoding)) { + return false; + } + } + + return true; + } public static function mb_detect_encoding($str, $encodingList = null, $strict = false) @@ -488,7 +512,7 @@ public static function mb_strlen($s, $encoding = null) return \strlen($s); } - return @\iconv_strlen($s, $encoding); + return @iconv_strlen($s, $encoding); } public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) @@ -509,7 +533,7 @@ public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = nu return 0; } - return \iconv_strpos($haystack, $needle, $offset, $encoding); + return iconv_strpos($haystack, $needle, $offset, $encoding); } public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) @@ -533,7 +557,7 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = n } $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? \iconv_strrpos($haystack, $needle, $encoding) + ? iconv_strrpos($haystack, $needle, $encoding) : self::mb_strlen($haystack, $encoding); return false !== $pos ? $offset + $pos : false; @@ -541,7 +565,7 @@ public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = n public static function mb_str_split($string, $split_length = 1, $encoding = null) { - if (null !== $string && !is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); return null; @@ -550,6 +574,7 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null if (1 > $split_length = (int) $split_length) { if (80000 > \PHP_VERSION_ID) { trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); + return false; } @@ -568,7 +593,7 @@ public static function mb_str_split($string, $split_length = 1, $encoding = null } $rx .= '.{'.$split_length.'})/us'; - return preg_split($rx, $string, null, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); + return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); } $result = []; @@ -617,7 +642,7 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) } if ($start < 0) { - $start = \iconv_strlen($s, $encoding) + $start; + $start = iconv_strlen($s, $encoding) + $start; if ($start < 0) { $start = 0; } @@ -626,19 +651,21 @@ public static function mb_substr($s, $start, $length = null, $encoding = null) if (null === $length) { $length = 2147483647; } elseif ($length < 0) { - $length = \iconv_strlen($s, $encoding) + $length - $start; + $length = iconv_strlen($s, $encoding) + $length - $start; if ($length < 0) { return ''; } } - return (string) \iconv_substr($s, $start, $length, $encoding); + return (string) iconv_substr($s, $start, $length, $encoding); } public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + [$haystack, $needle] = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], [ + self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding), + self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding), + ]); return self::mb_strpos($haystack, $needle, $offset, $encoding); } @@ -657,7 +684,7 @@ public static function mb_strrchr($haystack, $needle, $part = false, $encoding = $pos = strrpos($haystack, $needle); } else { $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = \iconv_strrpos($haystack, $needle, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); } return self::getSubpart($pos, $part, $haystack, $encoding); @@ -673,8 +700,11 @@ public static function mb_strrichr($haystack, $needle, $part = false, $encoding public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + $haystack = self::mb_convert_case($haystack, \MB_CASE_LOWER, $encoding); + $needle = self::mb_convert_case($needle, \MB_CASE_LOWER, $encoding); + + $haystack = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $haystack); + $needle = str_replace(self::SIMPLE_CASE_FOLD[0], self::SIMPLE_CASE_FOLD[1], $needle); return self::mb_strrpos($haystack, $needle, $offset, $encoding); } @@ -736,12 +766,12 @@ public static function mb_strwidth($s, $encoding = null) $encoding = self::getEncoding($encoding); if ('UTF-8' !== $encoding) { - $s = \iconv($encoding, 'UTF-8//IGNORE', $s); + $s = iconv($encoding, 'UTF-8//IGNORE', $s); } $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - return ($wide << 1) + \iconv_strlen($s, 'UTF-8'); + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); } public static function mb_substr_count($haystack, $needle, $encoding = null) @@ -797,6 +827,50 @@ public static function mb_ord($s, $encoding = null) return $code; } + public static function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = \STR_PAD_RIGHT, string $encoding = null): string + { + if (!\in_array($pad_type, [\STR_PAD_RIGHT, \STR_PAD_LEFT, \STR_PAD_BOTH], true)) { + throw new \ValueError('mb_str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH'); + } + + if (null === $encoding) { + $encoding = self::mb_internal_encoding(); + } + + try { + $validEncoding = @self::mb_check_encoding('', $encoding); + } catch (\ValueError $e) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + // BC for PHP 7.3 and lower + if (!$validEncoding) { + throw new \ValueError(sprintf('mb_str_pad(): Argument #5 ($encoding) must be a valid encoding, "%s" given', $encoding)); + } + + if (self::mb_strlen($pad_string, $encoding) <= 0) { + throw new \ValueError('mb_str_pad(): Argument #3 ($pad_string) must be a non-empty string'); + } + + $paddingRequired = $length - self::mb_strlen($string, $encoding); + + if ($paddingRequired < 1) { + return $string; + } + + switch ($pad_type) { + case \STR_PAD_LEFT: + return self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding).$string; + case \STR_PAD_RIGHT: + return $string.self::mb_substr(str_repeat($pad_string, $paddingRequired), 0, $paddingRequired, $encoding); + default: + $leftPaddingLength = floor($paddingRequired / 2); + $rightPaddingLength = $paddingRequired - $leftPaddingLength; + + return self::mb_substr(str_repeat($pad_string, $leftPaddingLength), 0, $leftPaddingLength, $encoding).$string.self::mb_substr(str_repeat($pad_string, $rightPaddingLength), 0, $rightPaddingLength, $encoding); + } + } + private static function getSubpart($pos, $part, $haystack, $encoding) { if (false === $pos) { diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/README.md b/tests/integration/vendor/symfony/polyfill-mbstring/README.md index 4efb599d8..478b40da2 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/README.md +++ b/tests/integration/vendor/symfony/polyfill-mbstring/README.md @@ -5,7 +5,7 @@ This component provides a partial, native PHP implementation for the [Mbstring](https://php.net/mbstring) extension. More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php b/tests/integration/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php new file mode 100644 index 000000000..512bba0bf --- /dev/null +++ b/tests/integration/vendor/symfony/polyfill-mbstring/Resources/unidata/caseFolding.php @@ -0,0 +1,119 @@ + 'i̇', + 'µ' => 'μ', + 'ſ' => 's', + 'ͅ' => 'ι', + 'ς' => 'σ', + 'ϐ' => 'β', + 'ϑ' => 'θ', + 'ϕ' => 'φ', + 'ϖ' => 'π', + 'ϰ' => 'κ', + 'ϱ' => 'ρ', + 'ϵ' => 'ε', + 'ẛ' => 'ṡ', + 'ι' => 'ι', + 'ß' => 'ss', + 'ʼn' => 'ʼn', + 'ǰ' => 'ǰ', + 'ΐ' => 'ΐ', + 'ΰ' => 'ΰ', + 'և' => 'եւ', + 'ẖ' => 'ẖ', + 'ẗ' => 'ẗ', + 'ẘ' => 'ẘ', + 'ẙ' => 'ẙ', + 'ẚ' => 'aʾ', + 'ẞ' => 'ss', + 'ὐ' => 'ὐ', + 'ὒ' => 'ὒ', + 'ὔ' => 'ὔ', + 'ὖ' => 'ὖ', + 'ᾀ' => 'ἀι', + 'ᾁ' => 'ἁι', + 'ᾂ' => 'ἂι', + 'ᾃ' => 'ἃι', + 'ᾄ' => 'ἄι', + 'ᾅ' => 'ἅι', + 'ᾆ' => 'ἆι', + 'ᾇ' => 'ἇι', + 'ᾈ' => 'ἀι', + 'ᾉ' => 'ἁι', + 'ᾊ' => 'ἂι', + 'ᾋ' => 'ἃι', + 'ᾌ' => 'ἄι', + 'ᾍ' => 'ἅι', + 'ᾎ' => 'ἆι', + 'ᾏ' => 'ἇι', + 'ᾐ' => 'ἠι', + 'ᾑ' => 'ἡι', + 'ᾒ' => 'ἢι', + 'ᾓ' => 'ἣι', + 'ᾔ' => 'ἤι', + 'ᾕ' => 'ἥι', + 'ᾖ' => 'ἦι', + 'ᾗ' => 'ἧι', + 'ᾘ' => 'ἠι', + 'ᾙ' => 'ἡι', + 'ᾚ' => 'ἢι', + 'ᾛ' => 'ἣι', + 'ᾜ' => 'ἤι', + 'ᾝ' => 'ἥι', + 'ᾞ' => 'ἦι', + 'ᾟ' => 'ἧι', + 'ᾠ' => 'ὠι', + 'ᾡ' => 'ὡι', + 'ᾢ' => 'ὢι', + 'ᾣ' => 'ὣι', + 'ᾤ' => 'ὤι', + 'ᾥ' => 'ὥι', + 'ᾦ' => 'ὦι', + 'ᾧ' => 'ὧι', + 'ᾨ' => 'ὠι', + 'ᾩ' => 'ὡι', + 'ᾪ' => 'ὢι', + 'ᾫ' => 'ὣι', + 'ᾬ' => 'ὤι', + 'ᾭ' => 'ὥι', + 'ᾮ' => 'ὦι', + 'ᾯ' => 'ὧι', + 'ᾲ' => 'ὰι', + 'ᾳ' => 'αι', + 'ᾴ' => 'άι', + 'ᾶ' => 'ᾶ', + 'ᾷ' => 'ᾶι', + 'ᾼ' => 'αι', + 'ῂ' => 'ὴι', + 'ῃ' => 'ηι', + 'ῄ' => 'ήι', + 'ῆ' => 'ῆ', + 'ῇ' => 'ῆι', + 'ῌ' => 'ηι', + 'ῒ' => 'ῒ', + 'ῖ' => 'ῖ', + 'ῗ' => 'ῗ', + 'ῢ' => 'ῢ', + 'ῤ' => 'ῤ', + 'ῦ' => 'ῦ', + 'ῧ' => 'ῧ', + 'ῲ' => 'ὼι', + 'ῳ' => 'ωι', + 'ῴ' => 'ώι', + 'ῶ' => 'ῶ', + 'ῷ' => 'ῶι', + 'ῼ' => 'ωι', + 'ff' => 'ff', + 'fi' => 'fi', + 'fl' => 'fl', + 'ffi' => 'ffi', + 'ffl' => 'ffl', + 'ſt' => 'st', + 'st' => 'st', + 'ﬓ' => 'մն', + 'ﬔ' => 'մե', + 'ﬕ' => 'մի', + 'ﬖ' => 'վն', + 'ﬗ' => 'մխ', +]; diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap.php b/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap.php index 1fedd1f7c..ecf1a0352 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap.php +++ b/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -132,6 +132,10 @@ function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap80.php b/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap80.php index 82f5ac4d0..2f9fb5b42 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ b/tests/integration/vendor/symfony/polyfill-mbstring/bootstrap80.php @@ -128,6 +128,10 @@ function mb_scrub(?string $string, ?string $encoding = null): string { $encoding function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); } } +if (!function_exists('mb_str_pad')) { + function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); } +} + if (extension_loaded('mbstring')) { return; } diff --git a/tests/integration/vendor/symfony/polyfill-mbstring/composer.json b/tests/integration/vendor/symfony/polyfill-mbstring/composer.json index 1fa21ca16..943e50296 100644 --- a/tests/integration/vendor/symfony/polyfill-mbstring/composer.json +++ b/tests/integration/vendor/symfony/polyfill-mbstring/composer.json @@ -31,7 +31,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-php73/LICENSE b/tests/integration/vendor/symfony/polyfill-php73/LICENSE index 3f853aaf3..7536caeae 100644 --- a/tests/integration/vendor/symfony/polyfill-php73/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-php73/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2019 Fabien Potencier +Copyright (c) 2018-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-php73/README.md b/tests/integration/vendor/symfony/polyfill-php73/README.md index b3ebbce51..032fafbda 100644 --- a/tests/integration/vendor/symfony/polyfill-php73/README.md +++ b/tests/integration/vendor/symfony/polyfill-php73/README.md @@ -10,7 +10,7 @@ This component provides functions added to PHP 7.3 core: - [`JsonException`](https://php.net/JsonException) More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-php73/composer.json b/tests/integration/vendor/symfony/polyfill-php73/composer.json index a7fe47875..48295ef97 100644 --- a/tests/integration/vendor/symfony/polyfill-php73/composer.json +++ b/tests/integration/vendor/symfony/polyfill-php73/composer.json @@ -26,7 +26,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-php80/LICENSE b/tests/integration/vendor/symfony/polyfill-php80/LICENSE index 5593b1d84..0ed3a2465 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-php80/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Fabien Potencier +Copyright (c) 2020-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-php80/README.md b/tests/integration/vendor/symfony/polyfill-php80/README.md index 10b8ee49a..3816c559d 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/README.md +++ b/tests/integration/vendor/symfony/polyfill-php80/README.md @@ -3,12 +3,13 @@ Symfony Polyfill / Php80 This component provides features added to PHP 8.0 core: -- `Stringable` interface +- [`Stringable`](https://php.net/stringable) interface - [`fdiv`](https://php.net/fdiv) -- `ValueError` class -- `UnhandledMatchError` class +- [`ValueError`](https://php.net/valueerror) class +- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class - `FILTER_VALIDATE_BOOL` constant - [`get_debug_type`](https://php.net/get_debug_type) +- [`PhpToken`](https://php.net/phptoken) class - [`preg_last_error_msg`](https://php.net/preg_last_error_msg) - [`str_contains`](https://php.net/str_contains) - [`str_starts_with`](https://php.net/str_starts_with) diff --git a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php index 7ea6d2772..2b955423f 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + #[Attribute(Attribute::TARGET_CLASS)] final class Attribute { diff --git a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php index 72f10812b..bd1212f6e 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -1,6 +1,15 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { class PhpToken extends Symfony\Polyfill\Php80\PhpToken { } diff --git a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php index 77e037cb5..7c62d7508 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + if (\PHP_VERSION_ID < 80000) { interface Stringable { diff --git a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php index 37937cbfa..01c6c6c8a 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + if (\PHP_VERSION_ID < 80000) { class UnhandledMatchError extends Error { diff --git a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php index a3a9b88b0..783dbc28c 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ b/tests/integration/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + if (\PHP_VERSION_ID < 80000) { class ValueError extends Error { diff --git a/tests/integration/vendor/symfony/polyfill-php80/composer.json b/tests/integration/vendor/symfony/polyfill-php80/composer.json index 5fe679db3..f1801f403 100644 --- a/tests/integration/vendor/symfony/polyfill-php80/composer.json +++ b/tests/integration/vendor/symfony/polyfill-php80/composer.json @@ -30,7 +30,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/polyfill-php81/LICENSE b/tests/integration/vendor/symfony/polyfill-php81/LICENSE index efb17f98e..99c6bdf35 100644 --- a/tests/integration/vendor/symfony/polyfill-php81/LICENSE +++ b/tests/integration/vendor/symfony/polyfill-php81/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2021 Fabien Potencier +Copyright (c) 2021-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/polyfill-php81/README.md b/tests/integration/vendor/symfony/polyfill-php81/README.md index 5ef61be6a..c07ef7820 100644 --- a/tests/integration/vendor/symfony/polyfill-php81/README.md +++ b/tests/integration/vendor/symfony/polyfill-php81/README.md @@ -4,11 +4,13 @@ Symfony Polyfill / Php81 This component provides features added to PHP 8.1 core: - [`array_is_list`](https://php.net/array_is_list) -- [`MYSQLI_REFRESH_REPLICA`](https://www.php.net/manual/en/mysqli.constants.php#constantmysqli-refresh-replica) constant +- [`enum_exists`](https://php.net/enum-exists) +- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant - [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) +- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). License ======= diff --git a/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php new file mode 100644 index 000000000..eb5952ee3 --- /dev/null +++ b/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { + /** + * @property string $data + */ + class CURLStringFile extends CURLFile + { + private $data; + + public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') + { + $this->data = $data; + parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); + } + + public function __set(string $name, $value): void + { + if ('data' !== $name) { + $this->$name = $value; + + return; + } + + if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { + throw new \TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); + } + + $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); + } + + public function __isset(string $name): bool + { + return isset($this->$name); + } + + public function &__get(string $name) + { + return $this->$name; + } + } +} diff --git a/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php b/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php index f4cad34f6..cb7720a8d 100644 --- a/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php +++ b/tests/integration/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + if (\PHP_VERSION_ID < 80100) { #[Attribute(Attribute::TARGET_METHOD)] final class ReturnTypeWillChange diff --git a/tests/integration/vendor/symfony/polyfill-php81/composer.json b/tests/integration/vendor/symfony/polyfill-php81/composer.json index c39ccf477..e02d673d4 100644 --- a/tests/integration/vendor/symfony/polyfill-php81/composer.json +++ b/tests/integration/vendor/symfony/polyfill-php81/composer.json @@ -26,7 +26,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/tests/integration/vendor/symfony/string/AbstractString.php b/tests/integration/vendor/symfony/string/AbstractString.php index cf21fef1f..13567c7b0 100644 --- a/tests/integration/vendor/symfony/string/AbstractString.php +++ b/tests/integration/vendor/symfony/string/AbstractString.php @@ -245,7 +245,7 @@ abstract public function chunk(int $length = 1): array; public function collapseWhitespace(): self { $str = clone $this; - $str->string = trim(preg_replace('/(?:\s{2,}+|[^\S ])/', ' ', $str->string)); + $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); return $str; } diff --git a/tests/integration/vendor/symfony/string/AbstractUnicodeString.php b/tests/integration/vendor/symfony/string/AbstractUnicodeString.php index db810cb6d..80b8326ae 100644 --- a/tests/integration/vendor/symfony/string/AbstractUnicodeString.php +++ b/tests/integration/vendor/symfony/string/AbstractUnicodeString.php @@ -37,8 +37,8 @@ abstract class AbstractUnicodeString extends AbstractString private const ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"; // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'İ', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'i̇', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; + private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; + private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; // the subset of upper case mappings that map one code point to many code points private const UPPER_FROM = ['ß', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'և', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ', 'ʼn', 'ΐ', 'ΰ', 'ǰ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾶ', 'ῆ', 'ῒ', 'ΐ', 'ῖ', 'ῗ', 'ῢ', 'ΰ', 'ῤ', 'ῦ', 'ῧ', 'ῶ']; @@ -162,7 +162,7 @@ public function ascii(array $rules = []): self public function camel(): parent { $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b./u', static function ($m) use (&$i) { + $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) use (&$i) { return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); @@ -366,7 +366,7 @@ public function reverse(): parent public function snake(): parent { - $str = $this->camel()->title(); + $str = $this->camel(); $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); return $str; @@ -492,14 +492,17 @@ public function width(bool $ignoreAnsiDecoration = true): int foreach (explode("\n", $s) as $s) { if ($ignoreAnsiDecoration) { $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [0x40-\x7E] + \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] | [P\]X^_] .*? \x1B\\\\ | [\x41-\x7E] )|[\p{Cc}\x7F]++)/xu', '', $s); } - // Non printable characters have been dropped, so wcswidth cannot logically return -1. - $width += $this->wcswidth($s); + $lineWidth = $this->wcswidth($s); + + if ($lineWidth > $width) { + $width = $lineWidth; + } } return $width; diff --git a/tests/integration/vendor/symfony/string/ByteString.php b/tests/integration/vendor/symfony/string/ByteString.php index bbf8614cf..626d8c1bb 100644 --- a/tests/integration/vendor/symfony/string/ByteString.php +++ b/tests/integration/vendor/symfony/string/ByteString.php @@ -103,7 +103,10 @@ public function append(string ...$suffix): parent public function camel(): parent { $str = clone $this; - $str->string = lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); + + $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); + $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); + $str->string = implode('', $parts); return $str; } @@ -363,7 +366,7 @@ public function slice(int $start = 0, int $length = null): parent public function snake(): parent { - $str = $this->camel()->title(); + $str = $this->camel(); $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); return $str; diff --git a/tests/integration/vendor/symfony/string/Inflector/EnglishInflector.php b/tests/integration/vendor/symfony/string/Inflector/EnglishInflector.php index 9f2fac675..5d16977e4 100644 --- a/tests/integration/vendor/symfony/string/Inflector/EnglishInflector.php +++ b/tests/integration/vendor/symfony/string/Inflector/EnglishInflector.php @@ -55,6 +55,9 @@ final class EnglishInflector implements InflectorInterface // indices (index), appendices (appendix), prices (price) ['seci', 4, false, true, ['ex', 'ix', 'ice']], + // codes (code) + ['sedoc', 5, false, true, 'code'], + // selfies (selfie) ['seifles', 7, true, true, 'selfie'], @@ -64,6 +67,9 @@ final class EnglishInflector implements InflectorInterface // movies (movie) ['seivom', 6, true, true, 'movie'], + // names (name) + ['seman', 5, true, false, 'name'], + // conspectuses (conspectus), prospectuses (prospectus) ['sesutcep', 8, true, true, 'pectus'], @@ -88,6 +94,9 @@ final class EnglishInflector implements InflectorInterface // accesses (access), addresses (address), kisses (kiss) ['sess', 4, true, false, 'ss'], + // statuses (status) + ['sesutats', 8, true, true, 'status'], + // analyses (analysis), ellipses (ellipsis), fungi (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), @@ -132,6 +141,9 @@ final class EnglishInflector implements InflectorInterface // shoes (shoe) ['se', 2, true, true, ['', 'e']], + // status (status) + ['sutats', 6, true, true, 'status'], + // tags (tag) ['s', 1, true, true, ''], @@ -273,6 +285,9 @@ final class EnglishInflector implements InflectorInterface // circuses (circus) ['suc', 3, true, true, 'cuses'], + // status (status) + ['sutats', 6, true, true, ['status', 'statuses']], + // conspectuses (conspectus), prospectuses (prospectus) ['sutcep', 6, true, true, 'pectuses'], diff --git a/tests/integration/vendor/symfony/string/Inflector/FrenchInflector.php b/tests/integration/vendor/symfony/string/Inflector/FrenchInflector.php index 42f6125aa..612c8f2e0 100644 --- a/tests/integration/vendor/symfony/string/Inflector/FrenchInflector.php +++ b/tests/integration/vendor/symfony/string/Inflector/FrenchInflector.php @@ -100,7 +100,7 @@ final class FrenchInflector implements InflectorInterface ['/^mes(sieur|seigneur)s$/', 'mon\1'], ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - //Default rule + // Default rule ['/s$/i', ''], ]; @@ -108,7 +108,7 @@ final class FrenchInflector implements InflectorInterface * A list of words which should not be inflected. * This list is only used by singularize. */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; + private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; /** * {@inheritdoc} diff --git a/tests/integration/vendor/symfony/string/LICENSE b/tests/integration/vendor/symfony/string/LICENSE index 9c907a46a..f37c76b59 100644 --- a/tests/integration/vendor/symfony/string/LICENSE +++ b/tests/integration/vendor/symfony/string/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2019-2022 Fabien Potencier +Copyright (c) 2019-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/string/LazyString.php b/tests/integration/vendor/symfony/string/LazyString.php index b3801db77..9c7a9c58b 100644 --- a/tests/integration/vendor/symfony/string/LazyString.php +++ b/tests/integration/vendor/symfony/string/LazyString.php @@ -75,7 +75,7 @@ public static function fromStringable($value): self */ final public static function isStringable($value): bool { - return \is_string($value) || $value instanceof self || (\is_object($value) ? method_exists($value, '__toString') : is_scalar($value)); + return \is_string($value) || $value instanceof self || (\is_object($value) ? method_exists($value, '__toString') : \is_scalar($value)); } /** @@ -148,7 +148,7 @@ private static function getPrettyName(callable $callback): string } elseif ($callback instanceof \Closure) { $r = new \ReflectionFunction($callback); - if (false !== strpos($r->name, '{closure}') || !$class = $r->getClosureScopeClass()) { + if (false !== strpos($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { return $r->name; } diff --git a/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_wide.php index 43c802d05..5a647e67b 100644 --- a/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ b/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_wide.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 14.0.0 - * Date: 2021-09-17T09:20:30+02:00 + * Unicode version: 15.0.0 + * Date: 2022-10-05T17:16:36+02:00 */ return [ @@ -856,10 +856,18 @@ 110848, 110882, ], + [ + 110898, + 110898, + ], [ 110928, 110930, ], + [ + 110933, + 110933, + ], [ 110948, 110951, @@ -1005,7 +1013,7 @@ 128727, ], [ - 128733, + 128732, 128735, ], [ @@ -1038,39 +1046,31 @@ ], [ 129648, - 129652, - ], - [ - 129656, 129660, ], [ 129664, - 129670, + 129672, ], [ 129680, - 129708, - ], - [ - 129712, - 129722, + 129725, ], [ - 129728, + 129727, 129733, ], [ - 129744, - 129753, + 129742, + 129755, ], [ 129760, - 129767, + 129768, ], [ 129776, - 129782, + 129784, ], [ 131072, @@ -1082,10 +1082,10 @@ ], [ 173824, - 177976, + 177977, ], [ - 177977, + 177978, 177983, ], [ @@ -1130,6 +1130,14 @@ ], [ 201547, + 201551, + ], + [ + 201552, + 205743, + ], + [ + 205744, 262141, ], ]; diff --git a/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_zero.php b/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_zero.php index 63b082473..9ae733032 100644 --- a/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_zero.php +++ b/tests/integration/vendor/symfony/string/Resources/data/wcswidth_table_zero.php @@ -3,8 +3,8 @@ /* * This file has been auto-generated by the Symfony String Component for internal use. * - * Unicode version: 14.0.0 - * Date: 2021-09-17T09:20:30+02:00 + * Unicode version: 15.0.0 + * Date: 2022-10-05T17:16:37+02:00 */ return [ @@ -382,7 +382,7 @@ ], [ 3784, - 3789, + 3790, ], [ 3864, @@ -920,6 +920,10 @@ 69291, 69292, ], + [ + 69373, + 69375, + ], [ 69446, 69456, @@ -1008,6 +1012,10 @@ 70206, 70206, ], + [ + 70209, + 70209, + ], [ 70367, 70367, @@ -1252,6 +1260,30 @@ 73459, 73460, ], + [ + 73472, + 73473, + ], + [ + 73526, + 73530, + ], + [ + 73536, + 73536, + ], + [ + 73538, + 73538, + ], + [ + 78912, + 78912, + ], + [ + 78919, + 78933, + ], [ 92912, 92916, @@ -1348,6 +1380,10 @@ 122918, 122922, ], + [ + 123023, + 123023, + ], [ 123184, 123190, @@ -1360,6 +1396,10 @@ 123628, 123631, ], + [ + 124140, + 124143, + ], [ 125136, 125142, diff --git a/tests/integration/vendor/symfony/translation-contracts/LICENSE b/tests/integration/vendor/symfony/translation-contracts/LICENSE index 235841453..74cdc2dbf 100644 --- a/tests/integration/vendor/symfony/translation-contracts/LICENSE +++ b/tests/integration/vendor/symfony/translation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018-2021 Fabien Potencier +Copyright (c) 2018-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/translation-contracts/Test/TranslatorTest.php b/tests/integration/vendor/symfony/translation-contracts/Test/TranslatorTest.php index 890367657..a3e9b20af 100644 --- a/tests/integration/vendor/symfony/translation-contracts/Test/TranslatorTest.php +++ b/tests/integration/vendor/symfony/translation-contracts/Test/TranslatorTest.php @@ -362,7 +362,7 @@ protected function validateMatrix($nplural, $matrix, $expectSuccess = true) foreach ($matrix as $langCode => $data) { $indexes = array_flip($data); if ($expectSuccess) { - $this->assertEquals($nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); + $this->assertCount($nplural, $indexes, "Langcode '$langCode' has '$nplural' plural forms."); } else { $this->assertNotEquals((int) $nplural, \count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); } diff --git a/tests/integration/vendor/symfony/translation/CHANGELOG.md b/tests/integration/vendor/symfony/translation/CHANGELOG.md index 160b5e694..93615dcac 100644 --- a/tests/integration/vendor/symfony/translation/CHANGELOG.md +++ b/tests/integration/vendor/symfony/translation/CHANGELOG.md @@ -1,6 +1,13 @@ CHANGELOG ========= +5.4.21 +------ + + * [BC BREAK] The following data providers for `ProviderFactoryTestCase` are now static: + `supportsProvider()`, `createProvider()`, `unsupportedSchemeProvider()`and `incompleteDsnProvider()` + * [BC BREAK] `ProviderTestCase::toStringProvider()` is now static + 5.4 --- diff --git a/tests/integration/vendor/symfony/translation/Command/TranslationPullCommand.php b/tests/integration/vendor/symfony/translation/Command/TranslationPullCommand.php index 52da595c6..e2e7c00dc 100644 --- a/tests/integration/vendor/symfony/translation/Command/TranslationPullCommand.php +++ b/tests/integration/vendor/symfony/translation/Command/TranslationPullCommand.php @@ -142,7 +142,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int switch ($format) { case 'xlf20': $xliffVersion = '2.0'; - // no break + // no break case 'xlf12': $format = 'xlf'; } @@ -160,7 +160,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int if ($force) { foreach ($providerTranslations->getCatalogues() as $catalogue) { - $operation = new TargetOperation((new MessageCatalogue($catalogue->getLocale())), $catalogue); + $operation = new TargetOperation(new MessageCatalogue($catalogue->getLocale()), $catalogue); if ($intlIcu) { $operation->moveMessagesToIntlDomainsIfPossible(); } diff --git a/tests/integration/vendor/symfony/translation/Command/TranslationPushCommand.php b/tests/integration/vendor/symfony/translation/Command/TranslationPushCommand.php index 56c6f5b1c..bf6e8c948 100644 --- a/tests/integration/vendor/symfony/translation/Command/TranslationPushCommand.php +++ b/tests/integration/vendor/symfony/translation/Command/TranslationPushCommand.php @@ -20,6 +20,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; +use Symfony\Component\Translation\Provider\FilteringProvider; use Symfony\Component\Translation\Provider\TranslationProviderCollection; use Symfony\Component\Translation\Reader\TranslationReaderInterface; use Symfony\Component\Translation\TranslatorBag; @@ -130,6 +131,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int $force = $input->getOption('force'); $deleteMissing = $input->getOption('delete-missing'); + if (!$domains && $provider instanceof FilteringProvider) { + $domains = $provider->getDomains(); + } + + // Reading local translations must be done after retrieving the domains from the provider + // in order to manage only translations from configured domains $localTranslations = $this->readLocalTranslations($locales, $domains, $this->transPaths); if (!$domains) { diff --git a/tests/integration/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php b/tests/integration/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php index 18a71c45a..2ee13640c 100644 --- a/tests/integration/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php +++ b/tests/integration/vendor/symfony/translation/DependencyInjection/TranslatorPathsPass.php @@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; +use Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver; /** * @author Yonel Ceruto @@ -136,28 +137,20 @@ protected function processValue($value, bool $isRoot = false) private function findControllerArguments(ContainerBuilder $container): array { - if ($container->hasDefinition($this->resolverServiceId)) { - $argument = $container->getDefinition($this->resolverServiceId)->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - - return $argument->getArgument(0); + if (!$container->has($this->resolverServiceId)) { + return []; } + $resolverDef = $container->findDefinition($this->resolverServiceId); - if ($container->hasDefinition('debug.'.$this->resolverServiceId)) { - $argument = $container->getDefinition('debug.'.$this->resolverServiceId)->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } - $argument = $argument->getArgument(0); - if ($argument instanceof Reference) { - $argument = $container->getDefinition($argument); - } + if (TraceableValueResolver::class === $resolverDef->getClass()) { + $resolverDef = $container->getDefinition($resolverDef->getArgument(0)); + } - return $argument->getArgument(0); + $argument = $resolverDef->getArgument(0); + if ($argument instanceof Reference) { + $argument = $container->getDefinition($argument); } - return []; + return $argument->getArgument(0); } } diff --git a/tests/integration/vendor/symfony/translation/Dumper/IcuResFileDumper.php b/tests/integration/vendor/symfony/translation/Dumper/IcuResFileDumper.php index cdc59913b..12a7a8cfc 100644 --- a/tests/integration/vendor/symfony/translation/Dumper/IcuResFileDumper.php +++ b/tests/integration/vendor/symfony/translation/Dumper/IcuResFileDumper.php @@ -47,7 +47,7 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra $data .= pack('V', \strlen($target)) .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') .$this->writePadding($data) - ; + ; } $resOffset = $this->getPosition($data); @@ -56,7 +56,7 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra .$indexes .$this->writePadding($data) .$resources - ; + ; $bundleTop = $this->getPosition($data); diff --git a/tests/integration/vendor/symfony/translation/Dumper/MoFileDumper.php b/tests/integration/vendor/symfony/translation/Dumper/MoFileDumper.php index 54d0da875..f52206ee3 100644 --- a/tests/integration/vendor/symfony/translation/Dumper/MoFileDumper.php +++ b/tests/integration/vendor/symfony/translation/Dumper/MoFileDumper.php @@ -62,7 +62,7 @@ public function formatCatalogue(MessageCatalogue $messages, string $domain, arra .$targetOffsets .$sources .$targets - ; + ; return $output; } diff --git a/tests/integration/vendor/symfony/translation/LICENSE b/tests/integration/vendor/symfony/translation/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/translation/LICENSE +++ b/tests/integration/vendor/symfony/translation/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/translation/Loader/ArrayLoader.php b/tests/integration/vendor/symfony/translation/Loader/ArrayLoader.php index 0758da8b5..feed0de4b 100644 --- a/tests/integration/vendor/symfony/translation/Loader/ArrayLoader.php +++ b/tests/integration/vendor/symfony/translation/Loader/ArrayLoader.php @@ -46,9 +46,11 @@ private function flatten(array $messages): array foreach ($messages as $key => $value) { if (\is_array($value)) { foreach ($this->flatten($value) as $k => $v) { - $result[$key.'.'.$k] = $v; + if (null !== $v) { + $result[$key.'.'.$k] = $v; + } } - } else { + } elseif (null !== $value) { $result[$key] = $value; } } diff --git a/tests/integration/vendor/symfony/translation/Loader/IcuResFileLoader.php b/tests/integration/vendor/symfony/translation/Loader/IcuResFileLoader.php index 7e3391ecb..6b7834e67 100644 --- a/tests/integration/vendor/symfony/translation/Loader/IcuResFileLoader.php +++ b/tests/integration/vendor/symfony/translation/Loader/IcuResFileLoader.php @@ -71,7 +71,7 @@ public function load($resource, string $locale, string $domain = 'messages') * * @param \ResourceBundle $rb The ResourceBundle that will be flattened * @param array $messages Used internally for recursive calls - * @param string $path Current path being parsed, used internally for recursive calls + * @param string|null $path Current path being parsed, used internally for recursive calls * * @return array */ diff --git a/tests/integration/vendor/symfony/translation/Loader/PhpFileLoader.php b/tests/integration/vendor/symfony/translation/Loader/PhpFileLoader.php index 85f10902b..40f64db27 100644 --- a/tests/integration/vendor/symfony/translation/Loader/PhpFileLoader.php +++ b/tests/integration/vendor/symfony/translation/Loader/PhpFileLoader.php @@ -25,7 +25,7 @@ class PhpFileLoader extends FileLoader */ protected function loadResource(string $resource) { - if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { + if ([] === self::$cache && \function_exists('opcache_invalidate') && filter_var(\ini_get('opcache.enable'), \FILTER_VALIDATE_BOOLEAN) && (!\in_array(\PHP_SAPI, ['cli', 'phpdbg'], true) || filter_var(\ini_get('opcache.enable_cli'), \FILTER_VALIDATE_BOOLEAN))) { self::$cache = null; } diff --git a/tests/integration/vendor/symfony/translation/MessageCatalogue.php b/tests/integration/vendor/symfony/translation/MessageCatalogue.php index ff49b5a97..9da3b7f00 100644 --- a/tests/integration/vendor/symfony/translation/MessageCatalogue.php +++ b/tests/integration/vendor/symfony/translation/MessageCatalogue.php @@ -155,19 +155,14 @@ public function replace(array $messages, string $domain = 'messages') */ public function add(array $messages, string $domain = 'messages') { - if (!isset($this->messages[$domain])) { - $this->messages[$domain] = []; - } - $intlDomain = $domain; - if (!str_ends_with($domain, self::INTL_DOMAIN_SUFFIX)) { - $intlDomain .= self::INTL_DOMAIN_SUFFIX; - } + $altDomain = str_ends_with($domain, self::INTL_DOMAIN_SUFFIX) ? substr($domain, 0, -\strlen(self::INTL_DOMAIN_SUFFIX)) : $domain.self::INTL_DOMAIN_SUFFIX; foreach ($messages as $id => $message) { - if (isset($this->messages[$intlDomain]) && \array_key_exists($id, $this->messages[$intlDomain])) { - $this->messages[$intlDomain][$id] = $message; - } else { - $this->messages[$domain][$id] = $message; - } + unset($this->messages[$altDomain][$id]); + $this->messages[$domain][$id] = $message; + } + + if ([] === ($this->messages[$altDomain] ?? null)) { + unset($this->messages[$altDomain]); } } diff --git a/tests/integration/vendor/symfony/translation/MessageCatalogueInterface.php b/tests/integration/vendor/symfony/translation/MessageCatalogueInterface.php index cf7746c23..965bf008f 100644 --- a/tests/integration/vendor/symfony/translation/MessageCatalogueInterface.php +++ b/tests/integration/vendor/symfony/translation/MessageCatalogueInterface.php @@ -41,7 +41,7 @@ public function getDomains(); * * If $domain is null, it returns all messages. * - * @param string $domain The domain name + * @param string|null $domain The domain name * * @return array */ diff --git a/tests/integration/vendor/symfony/translation/PseudoLocalizationTranslator.php b/tests/integration/vendor/symfony/translation/PseudoLocalizationTranslator.php index e004986a5..c769bdad0 100644 --- a/tests/integration/vendor/symfony/translation/PseudoLocalizationTranslator.php +++ b/tests/integration/vendor/symfony/translation/PseudoLocalizationTranslator.php @@ -283,7 +283,7 @@ private function expand(string &$trans, string $visibleText): void } $visibleLength = $this->strlen($visibleText); - $missingLength = (int) (ceil($visibleLength * $this->expansionFactor)) - $visibleLength; + $missingLength = (int) ceil($visibleLength * $this->expansionFactor) - $visibleLength; if ($this->brackets) { $missingLength -= 2; } diff --git a/tests/integration/vendor/symfony/translation/Resources/bin/translation-status.php b/tests/integration/vendor/symfony/translation/Resources/bin/translation-status.php index fac8acbad..53e642c00 100644 --- a/tests/integration/vendor/symfony/translation/Resources/bin/translation-status.php +++ b/tests/integration/vendor/symfony/translation/Resources/bin/translation-status.php @@ -9,6 +9,10 @@ * file that was distributed with this source code. */ +if ('cli' !== \PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + $usageInstructions = << */ - abstract public function supportsProvider(): iterable; + abstract public static function supportsProvider(): iterable; /** - * @return iterable + * @return iterable */ - abstract public function createProvider(): iterable; + abstract public static function createProvider(): iterable; /** * @return iterable */ - public function unsupportedSchemeProvider(): iterable + public static function unsupportedSchemeProvider(): iterable { return []; } @@ -60,7 +60,7 @@ public function unsupportedSchemeProvider(): iterable /** * @return iterable */ - public function incompleteDsnProvider(): iterable + public static function incompleteDsnProvider(): iterable { return []; } diff --git a/tests/integration/vendor/symfony/translation/Test/ProviderTestCase.php b/tests/integration/vendor/symfony/translation/Test/ProviderTestCase.php index 4eb08604b..cb8a03fc3 100644 --- a/tests/integration/vendor/symfony/translation/Test/ProviderTestCase.php +++ b/tests/integration/vendor/symfony/translation/Test/ProviderTestCase.php @@ -34,12 +34,12 @@ abstract class ProviderTestCase extends TestCase protected $loader; protected $xliffFileDumper; - abstract public function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; + abstract public static function createProvider(HttpClientInterface $client, LoaderInterface $loader, LoggerInterface $logger, string $defaultLocale, string $endpoint): ProviderInterface; /** - * @return iterable + * @return iterable */ - abstract public function toStringProvider(): iterable; + abstract public static function toStringProvider(): iterable; /** * @dataProvider toStringProvider diff --git a/tests/integration/vendor/symfony/translation/TranslatorBag.php b/tests/integration/vendor/symfony/translation/TranslatorBag.php index 6d98455e5..6a4df3c3c 100644 --- a/tests/integration/vendor/symfony/translation/TranslatorBag.php +++ b/tests/integration/vendor/symfony/translation/TranslatorBag.php @@ -70,7 +70,7 @@ public function diff(TranslatorBagInterface $diffBag): self $operation->moveMessagesToIntlDomainsIfPossible(AbstractOperation::NEW_BATCH); $newCatalogue = new MessageCatalogue($locale); - foreach ($operation->getDomains() as $domain) { + foreach ($catalogue->getDomains() as $domain) { $newCatalogue->add($operation->getNewMessages($domain), $domain); } @@ -94,7 +94,10 @@ public function intersect(TranslatorBagInterface $intersectBag): self $obsoleteCatalogue = new MessageCatalogue($locale); foreach ($operation->getDomains() as $domain) { - $obsoleteCatalogue->add($operation->getObsoleteMessages($domain), $domain); + $obsoleteCatalogue->add( + array_diff($operation->getMessages($domain), $operation->getNewMessages($domain)), + $domain + ); } $diff->addCatalogue($obsoleteCatalogue); diff --git a/tests/integration/vendor/symfony/yaml/Dumper.php b/tests/integration/vendor/symfony/yaml/Dumper.php index db3e346b1..99346aa1e 100644 --- a/tests/integration/vendor/symfony/yaml/Dumper.php +++ b/tests/integration/vendor/symfony/yaml/Dumper.php @@ -58,6 +58,8 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) { $output .= $prefix.Inline::dump($input, $flags); + } elseif ($input instanceof TaggedValue) { + $output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix); } else { $dumpAsMap = Inline::isHash($input); @@ -67,9 +69,7 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): } if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : ''; + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value); if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) { $blockChompingIndicator = '+'; @@ -96,9 +96,7 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): $output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag()); if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { - // If the first line starts with a space character, the spec requires a blockIndicationIndicator - // http://www.yaml.org/spec/1.2/spec.html#id2793979 - $blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : ''; + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); $output .= sprintf(' |%s', $blockIndentationIndicator); foreach (explode("\n", $value->getValue()) as $row) { @@ -108,7 +106,7 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): continue; } - if ($inline - 1 <= 0 || null === $value->getValue() || is_scalar($value->getValue())) { + if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { $output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; } else { $output .= "\n"; @@ -137,4 +135,42 @@ public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): return $output; } + + private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string + { + $output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag()); + + if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) { + $blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue()); + $output .= sprintf(' |%s', $blockIndentationIndicator); + + foreach (explode("\n", $value->getValue()) as $row) { + $output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row); + } + + return $output; + } + + if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) { + return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n"; + } + + return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags); + } + + private function getBlockIndentationIndicator(string $value): string + { + $lines = explode("\n", $value); + + // If the first line (that is neither empty nor contains only spaces) + // starts with a space character, the spec requires a block indentation indicator + // http://www.yaml.org/spec/1.2/spec.html#id2793979 + foreach ($lines as $line) { + if ('' !== trim($line, ' ')) { + return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : ''; + } + } + + return ''; + } } diff --git a/tests/integration/vendor/symfony/yaml/Inline.php b/tests/integration/vendor/symfony/yaml/Inline.php index 3d64b1ada..04c9690c9 100644 --- a/tests/integration/vendor/symfony/yaml/Inline.php +++ b/tests/integration/vendor/symfony/yaml/Inline.php @@ -50,9 +50,9 @@ public static function initialize(int $flags, int $parsedLineNumber = null, stri /** * Converts a YAML string to a PHP value. * - * @param string $value A YAML string - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior - * @param array $references Mapping of variable names to values + * @param string|null $value A YAML string + * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior + * @param array $references Mapping of variable names to values * * @return mixed * @@ -68,7 +68,7 @@ public static function parse(string $value = null, int $flags = 0, array &$refer return ''; } - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('ASCII'); } @@ -86,7 +86,7 @@ public static function parse(string $value = null, int $flags = 0, array &$refer ++$i; break; default: - $result = self::parseScalar($value, $flags, null, $i, null === $tag, $references); + $result = self::parseScalar($value, $flags, null, $i, true, $references); } // some comments are allowed at the end @@ -657,7 +657,6 @@ private static function evaluateScalar(string $scalar, int $flags, array &$refer } return octdec($value); - // Optimize for returning strings. case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]): if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) { $scalar = str_replace('_', '', $scalar); diff --git a/tests/integration/vendor/symfony/yaml/LICENSE b/tests/integration/vendor/symfony/yaml/LICENSE index 88bf75bb4..0138f8f07 100644 --- a/tests/integration/vendor/symfony/yaml/LICENSE +++ b/tests/integration/vendor/symfony/yaml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2022 Fabien Potencier +Copyright (c) 2004-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/tests/integration/vendor/symfony/yaml/Parser.php b/tests/integration/vendor/symfony/yaml/Parser.php index 2701a4418..d8886bb18 100644 --- a/tests/integration/vendor/symfony/yaml/Parser.php +++ b/tests/integration/vendor/symfony/yaml/Parser.php @@ -43,7 +43,7 @@ class Parser * Parses a YAML file into a PHP value. * * @param string $filename The path to the YAML file to be parsed - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior * * @return mixed * @@ -72,7 +72,7 @@ public function parseFile(string $filename, int $flags = 0) * Parses a YAML string to a PHP value. * * @param string $value A YAML string - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior * * @return mixed * @@ -88,7 +88,7 @@ public function parse(string $value, int $flags = 0) $mbEncoding = null; - if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { + if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('UTF-8'); } @@ -711,7 +711,7 @@ private function moveToPreviousLine(): bool * Parses a YAML value. * * @param string $value A YAML value - * @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior + * @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior * @param string $context The parser context (either sequence or mapping) * * @return mixed @@ -982,7 +982,7 @@ private function isCurrentLineBlank(): bool */ private function isCurrentLineComment(): bool { - //checking explicitly the first char of the trim is faster than loops or strpos + // checking explicitly the first char of the trim is faster than loops or strpos $ltrimmedLine = '' !== $this->currentLine && ' ' === $this->currentLine[0] ? ltrim($this->currentLine, ' ') : $this->currentLine; return '' !== $ltrimmedLine && '#' === $ltrimmedLine[0]; diff --git a/tests/integration/vendor/symfony/yaml/Resources/bin/yaml-lint b/tests/integration/vendor/symfony/yaml/Resources/bin/yaml-lint index 0ad73d714..143869e01 100755 --- a/tests/integration/vendor/symfony/yaml/Resources/bin/yaml-lint +++ b/tests/integration/vendor/symfony/yaml/Resources/bin/yaml-lint @@ -10,6 +10,10 @@ * file that was distributed with this source code. */ +if ('cli' !== \PHP_SAPI) { + throw new Exception('This script must be run from the command line.'); +} + /** * Runs the Yaml lint command. * From 0f8117013681a8be5f77180b9288eaa62b5526e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Mon, 7 Aug 2023 09:14:39 +0200 Subject: [PATCH 2/6] try with prod ini file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4c181d990..b08decf8e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -101,7 +101,7 @@ jobs: # https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite coverage: none - ini-file: development + ini-file: production ini-values: disabled_functions= env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2a89de786b13bcfd4a088d32a81fb0e4bb044a3e Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Mon, 11 Sep 2023 13:42:10 +0200 Subject: [PATCH 3/6] fix(events): use our generic event type, not symfony's Signed-off-by: Arthur Schiwon --- lib/UserBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/UserBackend.php b/lib/UserBackend.php index 0368b40e8..b5b0a6a3d 100644 --- a/lib/UserBackend.php +++ b/lib/UserBackend.php @@ -22,6 +22,7 @@ namespace OCA\User_SAML; use OCP\Authentication\IApacheBackend; +use OCP\EventDispatcher\GenericEvent; use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\NotPermittedException; use OCP\IConfig; @@ -37,7 +38,6 @@ use OCP\Server; use OCP\User\Events\UserChangedEvent; use OCP\UserInterface; -use Symfony\Component\EventDispatcher\GenericEvent; class UserBackend implements IApacheBackend, UserInterface, IUserBackend { /** @var IConfig */ From 8e89104b4b6d0445d35d8783326977540b9902bf Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 26 Sep 2023 09:20:21 +0200 Subject: [PATCH 4/6] debug(behat): force HTTP/1.1 Signed-off-by: Arthur Schiwon --- tests/integration/features/bootstrap/FeatureContext.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/features/bootstrap/FeatureContext.php b/tests/integration/features/bootstrap/FeatureContext.php index db784a40a..8cf332207 100644 --- a/tests/integration/features/bootstrap/FeatureContext.php +++ b/tests/integration/features/bootstrap/FeatureContext.php @@ -41,6 +41,7 @@ public function __construct() { public function before() { $jar = new \GuzzleHttp\Cookie\FileCookieJar('/tmp/cookies_' . md5(openssl_random_pseudo_bytes(12))); $this->client = new \GuzzleHttp\Client([ + 'version' => 2.0, 'cookies' => $jar, 'verify' => false, 'allow_redirects' => [ From 27e75f98fca6ce36d675e3044f588f6e0e73c7bf Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 27 Sep 2023 19:27:41 +0200 Subject: [PATCH 5/6] tests(integration): use pre-build ldap container image Signed-off-by: Arthur Schiwon --- .github/workflows/integration.yml | 29 +-------- .../integration/data/98nextcloud-schema.ldif | 13 ---- tests/integration/data/entries.ldif | 64 ------------------- 3 files changed, 2 insertions(+), 104 deletions(-) delete mode 100644 tests/integration/data/98nextcloud-schema.ldif delete mode 100644 tests/integration/data/entries.ldif diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index b08decf8e..d0441a985 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,7 +21,7 @@ env: jobs: integration: - runs-on: self-hosted + runs-on: ubuntu-latest strategy: fail-fast: false @@ -37,12 +37,9 @@ jobs: services: directory: - image: quay.io/389ds/dirsrv:latest + image: ghcr.io/nextcloud/continuous-integration-user_saml-dirsrv:latest ports: - 389:3389/tcp - env: - DS_DM_PASSWORD: admin - DS_SUFFIX_NAME: dc=idptestbed options: --name directory sso: @@ -60,28 +57,6 @@ jobs: #- name: Test sso container #run: curl 'https://localhost:4443/idp/profile/SAML2/Redirect/SSO?SAMLRequest=nZJbj9MwEIXf%2BytWeW%2BduOnNaiuVLZdKpa2awgMvq6kzoZYc23gcWP49TgK7gMQ%2BMJYseezzac6RlwS1dmLThJs545cGKQzuYj3W2pDoLldJ442wQIqEgRpJBCmKzfu94KNUOG%2BDlVYnf8leVgER%2BqCs6WW77So5Hl7vj293hwd%2BzasK8mwOc15Opnk5wSpf5LOx5ItJCrzKJsBheu2lH9FT5KySiE0GPY2owZ2hACbEfsrHw3QxzLJLNhV8Jvj4Uy%2FdRrPKQOjktxAcCcYyPhulcWUiz%2FMxU6Vj0WKlNLJ2es7OWCqPMrCiOPac088IXilTKvP5ZefX%2FhGJd5fLaXg6FpcesvmVyL011NToC%2FRflcQP530%2FXJxNWwn6ZimIeTpPWSTh48jdHAPniDUR8NBGz7oNJCXrDr1sz6JLxa%2F%2FB1VjgBICLNnvpGe2E4foc7c9Wa3k967f1hvrawj%2FjiOLIbcdVQ6r7qloDDmUqlJYJk%2BYjdb2271HCLhKgm8wuWPrQT%2FLnz93%2FQM%3D&RelayState=http%3A%2F%2Flocalhost%3A8080%2Findex.php%2Fapps%2Fuser_saml%2Fsaml%2Flogin&SigAlg=http%3A%2F%2Fwww.w3.org%2F2001%2F04%2Fxmldsig-more%23rsa-sha256&Signature=ZsTglbAjFrUgyBsUcm1cMOyHV7rzXTr9YM4E38fXiS1mXT5HNfy%2BR4ho6DCYXAuCmcYQwzJ8EiMAFYAHdUQZt8EkCHcV10qvL2hKhkMMxkvRL2%2FYPSdrvit8VfSpwgbOYrZOAu4re5JDU%2F5CWJ2tZpRYfokA0gldS%2BFuodqETGqRthZB9ge7oTmQUUbH7RxlmU8UCiwfWc0RtUNC4P%2FrsVwDS9bUgAzrqOqs7KOoCnrJPn08Fdz2RmoxJapdmBt9BAHxeDce5RPo%2BIoI5c8JDIPcUEuhImWJFXJnoQRIkJLYIIfgoqoj%2Bgtc6Np1%2BOeHJBSzlATZqiOWUIInfarjBg%3D%3D' || sleep 20 - - name: Initialize LDAP Service - shell: bash - run: | - CONTAINER_NAME=directory - # Initialize LDAP Database. May wait until server is ready. - while : ; do - sleep 1 - if docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend create --suffix "${{ env.LDAP_SUFFIX }}" --be-name ci_root; then - break; - fi - if [ $(docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend suffix list | grep "${{ env.LDAP_SUFFIX }}" | wc -l) -eq 1 ]; then - break - fi - done - # Add custom schema - docker cp apps/${{ env.APP_NAME }}/tests/integration/data/98nextcloud-schema.ldif ${{ env.LDAP_CR_NAME }}:/etc/dirsrv/slapd-localhost/schema/ - docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost schema reload - # Add test entries - docker cp apps/${{ env.APP_NAME }}/tests/integration/data/entries.ldif ${{ env.LDAP_CR_NAME }}:/var/opt/ - docker exec ${{ env.LDAP_CR_NAME }} dsconf localhost backend import "${{ env.LDAP_SUFFIX }}" /var/opt/entries.ldif - date - - name: Checkout server uses: actions/checkout@v3 with: diff --git a/tests/integration/data/98nextcloud-schema.ldif b/tests/integration/data/98nextcloud-schema.ldif deleted file mode 100644 index 12114945a..000000000 --- a/tests/integration/data/98nextcloud-schema.ldif +++ /dev/null @@ -1,13 +0,0 @@ -dn: cn=schema -objectClass: top -objectClass: ldapSubentry -objectClass: subschema -cn: schema -aci: (target="ldap:///cn=schema")(targetattr !="aci")(version 3.0;acl "anonymous, no acis"; allow (read, search, compare) userdn = "ldap:///anyone";) -modifiersName: cn=Directory Manager -modifyTimestamp: 20230412120423Z -objectClasses: ( 1.3.6.1.4.1.49213.1.2.1 NAME 'nextcloudUser' AUXILIARY MUST cn MAY (nextcloudEnabled $ nextcloudQuota ) X-ORIGIN 'user defined' ) -objectClasses: ( 1.3.6.1.4.1.49213.1.2.2 NAME 'nextcloudGroup' AUXILIARY MUST cn MAY nextcloudEnabled X-ORIGIN 'user defined' ) -attributeTypes: ( 1.3.6.1.4.1.49213.1.1.1 NAME 'nextcloudEnabled' DESC 'whether user or group should be available in Nextcloud' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE X-ORIGIN 'user defined' ) -attributeTypes: ( 1.3.6.1.4.1.49213.1.1.2 NAME 'nextcloudQuota' DESC 'defines how much disk space is available for the user (e.g. 2 GB)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'user defined' ) -nsSchemaCSN: 64369e47000000000000 diff --git a/tests/integration/data/entries.ldif b/tests/integration/data/entries.ldif deleted file mode 100644 index 6d5832ef2..000000000 --- a/tests/integration/data/entries.ldif +++ /dev/null @@ -1,64 +0,0 @@ - -dn: dc=idptestbed -objectClass: top -objectClass: domain -dc: idptestbed -description: dc=idptestbed - -dn: cn=admin,dc=idptestbed -objectClass: simpleSecurityObject -objectClass: organizationalRole -cn: admin -userPassword: password -description: LDAP administrator - -dn: ou=Groups,dc=idptestbed -objectClass: top -objectClass: organizationalunit -ou: Groups - -dn: ou=People,dc=idptestbed -objectClass: top -objectClass: organizationalunit -ou: People - -dn: uid=student1,ou=People,dc=idptestbed -objectClass: organizationalPerson -objectClass: person -objectClass: top -objectClass: inetOrgPerson -objectClass: nextcloudUser -givenName: Stud -uid: student1 -sn: Ent -cn: Stud Ent -mail: student1@idptestbed.edu -userPassword: password -nextcloudQuota: 200 MB - -dn: uid=student2,ou=People,dc=idptestbed -objectClass: organizationalPerson -objectClass: person -objectClass: top -objectClass: inetOrgPerson -objectClass: nextcloudUser -givenName: Stud -uid: student2 -sn: Ent2 -cn: Stud Ent2 -mail: student2@idptestbed.edu -userPassword: password -nextcloudQuota: 1 GB - -dn: uid=staff1,ou=People,dc=idptestbed -objectClass: organizationalPerson -objectClass: person -objectClass: top -objectClass: inetOrgPerson -objectClass: nextcloudUser -givenName: St -uid: staff1 -sn: aff -cn: St aff -mail: staff1@idptestbed.edu -userPassword: password From 7d7f161a1a249f0f4f41aeb10529bc3e12d2751b Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 10 Oct 2023 20:25:45 +0200 Subject: [PATCH 6/6] ci(integration): run on Github runners only for now - garm runners often run into host system issues and render the test unreliable (Error response from daemon: symlink /proc/mounts/var/lib/docker/fuse-overlayfs/$hash-init/merged/etc/mtab: file exists) Signed-off-by: Arthur Schiwon --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index d0441a985..78c69bd91 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -21,7 +21,7 @@ env: jobs: integration: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: fail-fast: false